View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Mon Feb 21, 2005 11:59 pm Post subject: How do I compile a basic d program with mango libraries? |
|
|
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 |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Tue Feb 22, 2005 10:33 am Post subject: |
|
|
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 |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Tue Feb 22, 2005 10:39 am Post subject: |
|
|
Thanks Carlos, or should I say, Gracias Carlos. ;-)
that's all I needed.
josé |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Tue Feb 22, 2005 12:40 pm Post subject: |
|
|
De nada. |
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Tue Feb 22, 2005 1:19 pm Post subject: |
|
|
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 |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Sat Mar 05, 2005 3:37 am Post subject: |
|
|
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 |
|
|
|