FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Having trouble beginning

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
Ebbe



Joined: 11 Feb 2007
Posts: 5
Location: Denmark

PostPosted: Sun Feb 11, 2007 4:03 pm    Post subject: Having trouble beginning Reply with quote

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 Confused

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
View user's profile Send private message Yahoo Messenger MSN Messenger
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Mon Feb 12, 2007 5:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Ebbe



Joined: 11 Feb 2007
Posts: 5
Location: Denmark

PostPosted: Mon Feb 12, 2007 4:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
Ebbe



Joined: 11 Feb 2007
Posts: 5
Location: Denmark

PostPosted: Mon Feb 12, 2007 5:13 pm    Post subject: Reply with quote

Uhhh. Progress Smile

Looking through the build forum, I found the -op flag. It now compiles the basic import test. Now for some real testing Smile
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Tue Feb 13, 2007 4:39 am    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
Ebbe



Joined: 11 Feb 2007
Posts: 5
Location: Denmark

PostPosted: Tue Feb 13, 2007 8:59 am    Post subject: Reply with quote

ChristianK wrote:
As I said:

Quote:
add -op to put the .o files with the source files in the first place.



Oops Smile 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. Smile


Shall do, shall do.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group