import lib file in VC.Net
-
Hi everybody, i need to import a library file(winmm.lib) into my project using VC++.NET. The way to do that is so different from VC++ 6.0. Does anyone know how to do? Thanks in advance.
how about
#pragma comment(lib, "winmm.lib")
? that should work on both 6.0 and .NET
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
-
Hi everybody, i need to import a library file(winmm.lib) into my project using VC++.NET. The way to do that is so different from VC++ 6.0. Does anyone know how to do? Thanks in advance.
-
how about
#pragma comment(lib, "winmm.lib")
? that should work on both 6.0 and .NET
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
-
In Solution Explorer (left hand side widow). Clik properties/linker/additional Library directcories/ (point to directory where your lib is)
-
Thanks for your reply, Hendrik, but it didnt work. In VC6.0, i can import it in ProjectSetting\Link Tab, but in .NET - hix, cannot
you need to announce the whole path to your library file inside the pragma comment instruction ... #pragma comment(lib, "path_to_lib/libname.lib")
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
-
yes, but when do that, we've just showed VC++ where to find the library. Where do we put the library name?
There is no need to write your lib name in project settings. The easy way is to just point to the directory the .lib file is stored or as already mentioned, like normaly you do with .h file ie. #include "test.h" with lib you write : #pragma comment (lib, "test.lib") wherever you use your library. thats it. Make sure you compile your libraries in release mode when creating the .lib Hope this helps :o)