How can I link .lib (static not dll) with my project? (VC 6.0)
I don't want to insert another project into workspace.
How can I link .lib (static not dll) with my project? (VC 6.0)
I don't want to insert another project into workspace.
In the linker settings, you add
- the path to where the library is located (if it's not there already)
- the name of the library to be linked
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Tnx,
but can I also do this without changing project settings - in code?
???Code:#pragma comment(lib, "./API/mylib.lib")
If you would like to sacrafice portability, then you may.
Portability? Between different VC versions?Originally Posted by Tonto
No, between different platforms.
Now I'm confused...
It works with Win XP, 2K, 98.
Did you mean non-windows platforms?
Likely it won't work for me, and I'm on Windows 98. #pragma is compiler dependant. Someone on a Mac/Linux box definately won't be using VC, and even some Windows users (like me) aren't. (MinGW/gcc)
What's so wrong with putting it in the project options? Besides, what source file would you locate a #pragma in? One or all? If you later want to change that #pragma, you then either have to hunt for one source file, if you're not familiar with the project, or change several. And when linking, it seems it'll be less obvious what's getting linked than if you specify somewhere centralized, like project options or a makefile.
long time; /* know C? */
Unprecedented performance: Nothing ever ran this slow before.
Any sufficiently advanced bug is indistinguishable from a feature.
Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
The best way to accelerate an IBM is at 9.8 m/s/s.
recursion (re - cur' - zhun) n. 1. (see recursion)
I'm using anyway MFC, so the portability... "is not a problem"
I tried to change the link settings, but I'm doing something wrong, because it wont work, linker gives errors (LNK2001 - unresolved external symbol). But it works with #pragma... thats the reason why I use it
Last edited by fiff; 12-28-2006 at 03:50 PM.