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

How do I compile a basic d program with mango libraries?

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Mon Feb 21, 2005 11:59 pm    Post subject: How do I compile a basic d program with mango libraries? Reply with quote

Folks,

I have looked for more than 1/2 hour to compile a simple sample program, but there are no instructions anywhere. Well, not that I can find. None of the documentation download (mango_release_1-1_doc.zip) contain any d sample compile commands. Does any one have any website where it would show some d compile samples?

thanks,

josé
Back to top
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Tue Feb 22, 2005 10:33 am    Post subject: Reply with quote

If on Windows, in the Mango examples download there's a makefile in order to compile them. Just type "make -f win32.make" (if I'm not mistaken) and you're set.
On linux, the examples can also be built with a makefile: "make -f linux.make example". Replace "example" with cserver, or cclient, or another example available in the makefile.
After that, review the makefiles to know how to do without them. The basic things to remember are: include Mango in the include search path (-Ipath_to_mango), link the Mango lib (mango.lib or mango_r.lib on Windows, libmango.a on linux), and link a winsock library on Windows (ws2_32.lib or wsock32.lib).
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Tue Feb 22, 2005 10:39 am    Post subject: Reply with quote

Thanks Carlos, or should I say, Gracias Carlos. ;-)

that's all I needed.

josé
Back to top
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Tue Feb 22, 2005 12:40 pm    Post subject: Reply with quote

De nada.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Tue Feb 22, 2005 1:19 pm    Post subject: Reply with quote

Just for future reference to others:

to compile using d and windows, the mango_r.lib must be linked. So, if I have a d program called mangoIO.d, the command to compile would be:

dmd mangoIO.d mango_r.lib

this will create a mangoIO.exe file.

thanks,

josé
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sat Mar 05, 2005 3:37 am    Post subject: Reply with quote

For a simpler approach, try using build.exe instead of the makefile and the library. There's an example over here: http://dsource.org/forums/viewtopic.php?t=618

Build is hosted here on dsource.org
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango 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