Visual Studio.Net Question

Started by
7 comments, last by darkchrono4 20 years, 5 months ago
This is a stupid question, but how do you had pre compiled libraries (*.lib) to a project. I can''t find anything in the Config Manager.
Advertisement
Those are usually called static libraries.

First you need to set a path to the directory under Tools->Options->Projects->VC++ Directories->Library Files

Then Projects-> Properties->Linker->Input
and you add the name of the lib here, e.g. wsock32.lib.

You can also put
#pragma comment(lib, "wsock32.lib)
in a source file and it will link it in (this only works with MSVC, but since it's a comment the code will still compile on other platforms).

[edited by - Magmai Kai Holmlor on November 14, 2003 4:30:32 PM]
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
As Fruny mentioned in another thread on this exact subject a couple of days ago, you can also just add them directly to the project in question.

And a .lib can also be an import library.

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
By "them", I mean the .libs.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Thanks for the help. I just call them pre compiled librarys because thats what you have to do to use them.
alot of people dont like to do this, but personally, i use #pragmas

#pragma comment (lib, "mylibrary.lib")

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

-eldee;another space monkey;[ Forced Evolution Studios ]
I''ve never used them that way. Why is that bad?
I''m guessing it''s because AFAIK it''s not part of the C/C++ spec so it may not work on other compilers?
Doing "Projects-> Properties->Linker->Input" won''t work on another compiler either

Magmai: You don''t need to add the directory to VS.NET''s global lib path. The Linker->Additional Inputs entry takes absolute or relative paths.

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement