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

How to specify location of libs to be linked?

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
Abscissa



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Wed May 18, 2005 10:51 pm    Post subject: How to specify location of libs to be linked? Reply with quote

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



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 18, 2005 10:59 pm    Post subject: Reply with quote

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



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Wed May 18, 2005 11:07 pm    Post subject: Reply with quote

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



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 18, 2005 11:14 pm    Post subject: Reply with quote

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



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Wed May 18, 2005 11:35 pm    Post subject: Reply with quote

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



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 18, 2005 11:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build 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