View previous topic :: View next topic |
Author |
Message |
nascent
Joined: 07 Feb 2006 Posts: 26
|
Posted: Thu Oct 12, 2006 11:52 am Post subject: compiling FreeUniverse |
|
|
I'm trying to compile FreeUniverse from SVN repository. When gcc compiles the objects I get this
Code: |
gcc objects/FreeUniverse.o -o FreeUniverse -m32 -lphobos -lpthread -lm
objects/FreeUniverse.o:(.data+0x34): undefined reference to `_ModuleInfo_4init4init'
objects/FreeUniverse.o:(.data+0x38): undefined reference to `_ModuleInfo_6docked6docked'
objects/FreeUniverse.o: In function `_Dmain':
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x5): undefined reference to `_D4init4init16InitFreeUniverseFZx'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x36): undefined reference to `_D3arc2io6window5clearFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x3b): undefined reference to `_D4init4init8gameTimeC3arc3phy4time4Time'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x45): undefined reference to `_D3arc2io5input7processFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x4a): undefined reference to `_D4init4init9gameStatei'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x79): undefined reference to `_D4menu9main_menu14DisplayNewGameFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x80): undefined reference to `_D4init4init8gameTimeC3arc3phy4time4Time'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x8f): undefined reference to `_D4menu9main_menu15DisplayLoadGameFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x96): undefined reference to `_D4init4init8gameTimeC3arc3phy4time4Time'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xa2): undefined reference to `_D4menu9main_menu15DisplayMainMenuFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xa9): undefined reference to `_D4init4init8gameTimeC3arc3phy4time4Time'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xb6): undefined reference to `_D4init4init11globalTimerm'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xbd): undefined reference to `_D4init4init11globalTimerm'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xc4): undefined reference to `_D4init4init13selectionMadex'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xca): undefined reference to `_D5space7handler11HandleInputFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xcf): undefined reference to `_D5space7handler18HandleSpaceObjectsFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xd6): undefined reference to `_D4init4init8gameTimeC3arc3phy4time4Time'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xe2): undefined reference to `_D4init4init17CloseFreeUniverseFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xec): undefined reference to `_D6docked6docked11dockHandlerFZv'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0xf3): undefined reference to `_D4init4init8gameTimeC3arc3phy4time4Time'
FreeUniverse.d:(.gnu.linkonce.t_Dmain+0x118): undefined reference to `_D3arc2io6window4swapFZv'
|
I'm compiling this in linux. And Since I'm not even sure of my ability to compile a big project here is how I did it. I tried 'build' but since I have dmd place my objects in an objects directory build doesn't seem to tell gcc that, so I went into my objects directory and piped a find of all the object files to gcc
$ find -P -depth -regex ".+\.o"| gcc -o free FreeUniverse.o
I figured I should try it with dmd so
$ find -P -depth -regex ".+\.d" | dmd FreeUniverse.d _________________ I am myself and that is me. |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu Oct 12, 2006 2:23 pm Post subject: |
|
|
have you tried build command
build -Rn -full -cleanup -release -O ?
This will delete any objects created (not sure why you need them in seperate directory) and compile the whole thing.
From the above errors, it looks like GCC is not getting linked with your object files. |
|
Back to top |
|
|
ChristianK
Joined: 26 Sep 2006 Posts: 159 Location: Berlin, Germany
|
Posted: Thu Oct 12, 2006 2:29 pm Post subject: |
|
|
I also had trouble with build's ability to put object files in a seperate directory, so I'm generally compiling with
dbuild -op -L-ldl FreeUniverse.d
However, clay's -cleanup is generally a good idea, as is -O -release (-inline?) when compiling for release. |
|
Back to top |
|
|
nascent
Joined: 07 Feb 2006 Posts: 26
|
Posted: Thu Oct 12, 2006 11:06 pm Post subject: |
|
|
I tried it, (I don't have build on my path). I also tried it with another one file program and it does the same thing. each time stating that the args "-m32 -lphobos -lpthread -lm" are unknown.
Anyway the error above is what I get from using dmd directly. _________________ I am myself and that is me. |
|
Back to top |
|
|
ChristianK
Joined: 26 Sep 2006 Posts: 159 Location: Berlin, Germany
|
Posted: Fri Oct 13, 2006 3:46 am Post subject: |
|
|
I'm not at home and can't verify (and really recommend getting build to work). However
dmd FreeUniverse.d $(find -name "*.d" | grep -v FreeUniverse.d)
Should work, I think. You should let dmd do the linking - or at least check which flags it adds to the linker command. |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Fri Oct 13, 2006 7:34 am Post subject: |
|
|
Did you follow the *nix install directions?
http://digitalmars.com/d/dcompiler.html#linux
I've used build before on linux a while ago. You need all those compiler flags. I'd recommend to put build in your /bin directory as well. |
|
Back to top |
|
|
|