Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - Local struct problems, among others
I am trying to use Digital Mars for some game development. I had hoped to use the "Open Dynamics Engine v0.03" to provide physics. ODE only supports MSVC and CygWin as Win32 compilers, but I thought I might be able to fake it with some smallish modifications and the use of the DigitalMars CL.EXE command line translator. After fixing one or two #ifdef areas that misunderstood the compiler environment, the next error I got could be tracked down to (eventually) the following kind of code construct. The names have been changed, just 'coz I felt like it... //////////////////// struct Thing : public RootOfAllEvil { struct LocalThing { void * SomeStuff; }; LocalThing * Whoops; }; Thing::LocalThing * __GlobalWhoops; ////////////////////// At this point, anyone who attempts to use __GlobalWhoops as a Thing::LocalThing* will be informed either than an explicit cast is needed, or that __GlobalWhoops has already been defined as something else. The gist of the problem is that the compiler seems to think that __GlobalWhoops is of type Thing*, not of type Thing::LocalThing*. I have played with ordering and changing names, neither of which has any effect. Concerned that I might not have the newest compiler, I checked the version of dmc, and was told 8.29n. Which is odd, since I had applied the 8.30 CD patch. To be safe, I downloaded the compiler-only 8.30c zip file and applied that. The version is still reported as 8.29n. I finally gave up and moved all (there were several) local struct definitions out of dxJoint (the class upon which the contrived Thing was based), and then went around removing all of the scope resolution operators. This poluted the global name space, but at least it allowed the code to compile. Now that the code compiles, I have a new problem. While CL.EXE was able to translate the compiler switches, I don't have anything to translate the linker and librarian switches. When the make file attempts to bundle things up into a library, it chokes a great deal, confusing parts of the filespec as if it thought they were switches. For example: Warning: Unknown switch 'src' in command line, ignored. Warning: Unknown switch 'fastldlt' in command line, ignored. So my three problems are: 1. Does DMC have a problem with local structs (structs within structs)? 2. Is the newest DMC supposed to report 8.29n? 3. How can I easily translate command line switches designed for MSVC librarian to DMC librarian? Any help would be greatly appreciated. I would prefer to avoid going to CygWin, due to past painful experiences. Thanks, Mac Nov 03 2002
"Mac Reiter" <Mac_member pathlink.com> wrote in message news:aq4kt0$v7i$1 digitaldaemon.com...I am trying to use Digital Mars for some game development. I had hoped to Nov 04 2002
So my three problems are: 1. Does DMC have a problem with local structs (structs within structs)? Nov 04 2002
2. Is the newest DMC supposed to report 8.29n? Nov 04 2002
I think all you need to do for the librarian is: lib -c libraryname objfiles... For the linker, just list the .lib files: link obj+obj+obj,exe,map,Comctl32+kernel32+user32+gdi32+OpenGL32+Glu32.lib,def,re s; "Mac Reiter" <Mac_member pathlink.com> wrote in message news:aq6f2l$2s4h$1 digitaldaemon.com...2. Is the newest DMC supposed to report 8.29n? Nov 04 2002
|