View previous topic :: View next topic |
Author |
Message |
Ebbe
Joined: 11 Feb 2007 Posts: 5 Location: Denmark
|
Posted: Sun Feb 11, 2007 4:03 pm Post subject: Having trouble beginning |
|
|
Hi. I think this project seems very nice. I'd very much like to contribute in any way.. but before I do I would like my first program with Arc to.. compile
I'm using the latest dmd, gcc and bud on Linux. Also using the svn trunk of Arc. I'm putting the arc folder in the same folder as the program i'm trying to compile.
My (very basic) file is:
Code: | import arc.window;
void main()
{
}
|
Here's a try with dmd (My linking with my installed version of Derelict lies in the dmd.conf file):
Code: | $ dmd sdlstart.d
gcc sdlstart.o -o sdlstart -m32 -lphobos -lpthread -lm -Xlinker -lDerelictUtil -Xlinker -lDerelictSDL -Xlinker -lDerelictSDLMixer -Xlinker -lDerelictSDLttf -Xlinker -ldl
sdlstart.o:(.data+0x30): undefined reference to `_D3arc6window12__ModuleInfoZ'
collect2: ld returned 1 exit status
--- errorlevel 1
|
Bud gives me this:
Code: | $ bud sdlstart.d
gcc: arc/window.o: No such file or directory
gcc: arc/log.o: No such file or directory
gcc: arc/text/format.o: No such file or directory
gcc: arc/input.o: No such file or directory
gcc: /home/ebbe/dmd/src/ext/derelict/sdl/keysym.o: No such file or directory
gcc: /home/ebbe/dmd/src/ext/derelict/sdl/events.o: No such file or directory
gcc: /home/ebbe/dmd/src/ext/derelict/sdl/types.o: No such file or directory
*cut*
|
And keeps going on for many files. The *.o files are being generated in the same folder as the sdlstart.d file..
Can't really figure out why bud does this.
I can compile and link Derelict files fine.
Any help would be appreciated.
Thanks |
|
Back to top |
|
|
ChristianK
Joined: 26 Sep 2006 Posts: 159 Location: Berlin, Germany
|
Posted: Mon Feb 12, 2007 5:46 am Post subject: |
|
|
Thanks for your interest!
We don't yet offer to compile the svn-arc to a library (like you did with derelict), so you'll basically have to use a tool like bud/rebuild to build all the neccessary files (window.d and its dependencies, in your case).
Your second try should have worked, but there seems to be an issue with bud: it places the object files in your working directory, but looks for them among the source files: add -op to put the .o files with the source files in the first place.
Also you might have to use -L-ldl to link in the dynamic library loader, but since you already compiled derelict, you might not have to. |
|
Back to top |
|
|
Ebbe
Joined: 11 Feb 2007 Posts: 5 Location: Denmark
|
Posted: Mon Feb 12, 2007 4:55 pm Post subject: |
|
|
Hmm. I can see from other posts that you too use Linux. Can you explain what you do different?
You have the arc and derelict folders in the same place as the file you want compiled, and then you "build main.d -L-ldl"?
You do not have Derelict preinstalled?
Thanks for you time. |
|
Back to top |
|
|
Ebbe
Joined: 11 Feb 2007 Posts: 5 Location: Denmark
|
Posted: Mon Feb 12, 2007 5:13 pm Post subject: |
|
|
Uhhh. Progress
Looking through the build forum, I found the -op flag. It now compiles the basic import test. Now for some real testing |
|
Back to top |
|
|
ChristianK
Joined: 26 Sep 2006 Posts: 159 Location: Berlin, Germany
|
Posted: Tue Feb 13, 2007 4:39 am Post subject: |
|
|
As I said:
Quote: | add -op to put the .o files with the source files in the first place. |
Anyway, I'm glad it works for you now. I'd also recommend you take a look at some of the unit tests (some of them are just not written or very outdated at the moment) and the asteroids example in examples/asteroids (this one is still work in progress, but already more or less playable).
Let me know how your experiments go and if you encounter any other difficulties. |
|
Back to top |
|
|
Ebbe
Joined: 11 Feb 2007 Posts: 5 Location: Denmark
|
Posted: Tue Feb 13, 2007 8:59 am Post subject: |
|
|
ChristianK wrote: | As I said:
Quote: | add -op to put the .o files with the source files in the first place. |
|
Oops Maybe I shouldn't be so tired when experimenting and just read every line you write. Sorry.
ChristianK wrote: | Let me know how your experiments go and if you encounter any other difficulties. |
Shall do, shall do. |
|
Back to top |
|
|
|