• Advertisement

Archived

This topic is now archived and is closed to further replies.

Visual Studio.Net Question

This topic is 5216 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
I''m guessing it''s because AFAIK it''s not part of the C/C++ spec so it may not work on other compilers?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement