View previous topic :: View next topic |
Author |
Message |
Abscissa
Joined: 23 Feb 2005 Posts: 40 Location: Cleveland, OH, US
|
Posted: Wed May 18, 2005 10:51 pm Post subject: How to specify location of libs to be linked? |
|
|
Quote: | [pragma]
link
...
Example 2:
// This app needs the a DB library and TCP library to be used.
version(build) { pragma(link, EuDB, TCP4Win); }
|
That part of the documentation seems to imply that either build or dmd somehow know where to find the library you're trying to link in. But how does it know this? Is there some recommended way to either tell it where to find librares, or where specific ones are located? Or is there a specific location I should be keeping my libs? I'm unclear on this. |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed May 18, 2005 10:59 pm Post subject: |
|
|
I think build parses sc.ini and dmd.conf and perhaps paths included on the build command line.
At any rate, the pragma(link,...) comand is not working for me. I ended up having to manually add the libraries to the command line on linux before symbols were found.
-JJR |
|
Back to top |
|
|
Abscissa
Joined: 23 Feb 2005 Posts: 40 Location: Cleveland, OH, US
|
Posted: Wed May 18, 2005 11:07 pm Post subject: |
|
|
Oh, heh, silly me. I just noticed this page which explains the LIB environment variable, sc.ini, and dmd.conf. Having used D as long as I have, you'd think I would have actually read that stuff by now . I guess I just add the paths to any libs onto the LIB environment variable either in autoexec or sc.ini on Windows, or in dmd.conf in Linux. |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed May 18, 2005 11:14 pm Post subject: |
|
|
Yeah... I typically add the paths of important libraries to sc.ini and dmd.conf. It sure saves typing on the command line when building projects. I also add the the import search paths there too with the -I option.
-JJR |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Wed May 18, 2005 11:35 pm Post subject: |
|
|
JJR wrote: | I think build parses sc.ini and dmd.conf and perhaps paths included on the build command line. |
That's right. Build uses the info in sc.ini/dmd.conf, and the command line to work out the library paths.
JJR wrote: |
At any rate, the pragma(link,...) comand is not working for me. I ended up having to manually add the libraries to the command line on linux before symbols were found.
-JJR |
Huh? The link pragma is not working? What's the problem? _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed May 18, 2005 11:54 pm Post subject: |
|
|
Ahh!! forget that one. It works great. I obviously had setup my files wrong. Build was not being called with the correct file.
Sorry for the scare.
-JJR |
|
Back to top |
|
|
|