I have done a search but I never saw in any post how to make a .lib. How can I do it?
And to use it I have read that I need something with #pragma, is that right?
Printable View
I have done a search but I never saw in any post how to make a .lib. How can I do it?
And to use it I have read that I need something with #pragma, is that right?
humm is this so hard?
No
probably no one here paying attention.
Do this:
MSVC 6 or 7:
File > New > Static Library
Then make all your code (classes, functions, bla)... and then compile it, thats all (Batch Build All should build you both debug and release libs... just use the release :))
Also, i would just make a little console app to test it and once it works, just put that into the static library workspace :)
cool
thank you :)
You can either add the lib to the project by clicking on Project > Settings > Link > "Object Library Modules" and typing it in the textbox "bla.lib"Quote:
Originally posted by Daok
And to use it I have read that I need something with #pragma, is that right?
or put this line in your main ".h" file:
just change thelibrary to whatever your lib is called, also if you want to have two different versions of your lib (debug and compile), just rename the debug one to "bla"d.lib so that they dont have the same name, and then do this:PHP Code:
#pragma comment(lib, "thelibrary.lib")
Peace!PHP Code:
#if !defined(_DEBUG)
// release version
#pragma comment(lib, "thelibrary.lib")
#else
// debug version
#pragma comment(lib, "thelibraryd.lib")
#endif
Very cool, tk you :)