digitalmars.D.learn - help using dmd on linux
- Bill Baxter (13/13) Dec 21 2006 I'm trying out D on Linux for the first time and am having trouble
- John Reimer (15/29) Dec 21 2006 Two things I can think of:
- Mike Parker (4/13) Dec 21 2006 That's probably the issue. I updated the trunk yesterday with a fix that...
I'm trying out D on Linux for the first time and am having trouble linking a program with extra library dependencies. This should be simple for anyone who has compiled on Linux before. Namely I'm trying to compile the sdl example in the Derelict examples directory. Here's the type of compile command I've tried to use: $ bud sdl_ex1.d -I../DerelictSDL -I../DerelictUtil -L-L../lib ..lib/libDerelictSDL.a ../lib/libDerelictUtil.a And various variations on that. But I keep getting a few pages errors like: gcc: /[path]/Derelict/DerelictSDL/derelict/sdl/sdl.o: No such file or directory Am I just not passing the -L../lib parameter right? --bb
Dec 21 2006
On Thu, 21 Dec 2006 18:55:06 -0800, Bill Baxter <dnewsgroup billbaxter.com> wrote:I'm trying out D on Linux for the first time and am having trouble linking a program with extra library dependencies. This should be simple for anyone who has compiled on Linux before. Namely I'm trying to compile the sdl example in the Derelict examples directory. Here's the type of compile command I've tried to use: $ bud sdl_ex1.d -I../DerelictSDL -I../DerelictUtil -L-L../lib ..lib/libDerelictSDL.a ../lib/libDerelictUtil.a And various variations on that. But I keep getting a few pages errors like: gcc: /[path]/Derelict/DerelictSDL/derelict/sdl/sdl.o: No such file or directory Am I just not passing the -L../lib parameter right? --bbTwo things I can think of: 1) If you use bud, it will compile all necessary files. No need to link with any libraries. Bud recurses the Derelict directories (as inferred from the import statements in your module), and manages the compiling and linking of the individual modules needed for the build. So you can remove all the library commands line args. An include directory to the derelict path will still be necessary. 2) You probably have to pass the "-op" flag to dmd which makes sure that object files stay put in the same directory as the source. By default all object files get stored in the working directory which can cause annoying problems later when gcc thinks they should be in the source directory. So try adding "-op" to your commandline. -JJR
Dec 21 2006
John Reimer wrote:On Thu, 21 Dec 2006 18:55:06 -0800, Bill Baxter <dnewsgroup billbaxter.com> wrote:2) You probably have to pass the "-op" flag to dmd which makes sure that object files stay put in the same directory as the source. By default all object files get stored in the working directory which can cause annoying problems later when gcc thinks they should be in the source directory. So try adding "-op" to your commandline.That's probably the issue. I updated the trunk yesterday with a fix that appends -op to the temporary brf generated by the build script on Linux. Hopefully this issue won't crop up anymore.
Dec 21 2006