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

How do you combine static library files?

Started by Drakkcon Dec 12, 2007 at 3:10 PM 2 replies 10.3k views
Original Post
Drakkcon
Drakkcon
I am making a simple game engine which has each subsystem as its own library file (engine_renderer.lib, engine_input.lib, etc.) but I want the user to have the option of simply linking one library file that includes everything (engine.lib). Also, there are third party libraries that my engine requires. The resource manager requires zlib for instance, and I don't want the user to have to link in zlib separately. How do I do this? Is there some sort of program that lets me merge lib files and object files, or more conveniently, a build option in Visual C++ express 2008? The reason I am asking is that I have never seen anything like this in any of my programming books and can't believe that no one would need a tool like this. I'm guessing the linker has this functionality, but whenever I try to run it I get the error message "This application has failed to start because mspdb80.dll was not found." which is very mysterious considering that that program is necessary for building. Thanks for any help!
streamer
streamer
Hm I think you can for example make forwarding messages to lib file and link it with your library. So if you want to your library use zlib library include that lib as dependency to your library and make own functions that forward parameters to zlib.
I.e. your project
void zZip(char* path)
{
zLib.zZip(path); // pass parameter to lib and execute
}
I'm not sure this will work but it is worth having a try.
Enigma
Enigma
Try lib /OUT:filename.lib input1.lib input2.lib .... You'll need to invoke vsvars32.bat first so that your enviroment variables are set correctly.

Σnigma
Drakkcon
Drakkcon
Quote:
Original post by Enigma
. . . You'll need to invoke vsvars32.bat first so that your enviroment variables are set correctly.

Σnigma


That explains the .dll errors I was getting. And thanks for explaining the use of lib.exe too! Sadly, I can not rate you up anymore.

Topic Locked

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

Sign in to reply to this topic.