Skip to main content
GameDev.net gamedev.net
🔒 Locked

Libraries and Dependancies

Started by dave Feb 20, 2007 at 9:37 PM 1 replies 400+ views
Original Post
dave
dave
My GUI library depends on currently 3 other libraries. I link all these in via the project properties linker input and add the header paths and link paths too. Now when i wish to use my GUI library (.lib) in another application i have to link my library in the project properties like usual, but i get lots of link errors only resolved by linking the 3 other libraries into the project settings for the application. Is there any way i can avoid having to link the 3 libraries into the application as well as when i build my library? Hope this makes sense. Dave
dave
dave
Bump
SunTzu
SunTzu
I know of no way to automatically link other libraries when explicitly linking only one. (Probably because the linker include path could change).

If you're just wanting to not have to bother with the link line at all, and are using VS.NET, you might like to investigate #pragma comment( lib, "x.lib" ) though. You can put that in a header file and anything that #includes that header will link with that library as well. This is MS specific though I daresay other compilers have similar tricks.

Personally I prefer to explicitly set everything on the link line. That way, you can run a mainly-Release build of your game, but link to graphicsD.lib instead of graphics.lib for debugging, for example.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.