Sign in to follow this  
f001error

How does the MSVC 6.0 complier/linker find external headers, includes and stuff

Recommended Posts

f001error    122
G'day I'm beating my head against wall with MSVC6.0. I've got a bunch of libaries which I want to use that live in seperate directories. So I need to tell MSVC6.0 where to look when I call an include and where the dlls are when link; I think thats all it needs to know. I tried playing around with the directories under options but it still didnt work. I really don't know how it works and couldn't find any general n00b friendly resources. If someone wouldn't mind explaining the process behind the complier/linker searching for stuff, or pushing me towards an online resource I would be very very greatful. Cheers

Share this post


Link to post
Share on other sites
Kambiz    758
The compiler do not need to know where the dlls(.dll files) are, you should tell the compiler where the libraries(.lib files) are. Then just add somthing like:
#pragma comment(lib,"yourlibrary.lib")
to your source file and compiler.

Share this post


Link to post
Share on other sites
taby    1265
It's in the compiler's options somewhere. I do not have MSVC++ 6.0, but there is an external dependencies options tab where you add a list of the directories that contain your .h and .lib files.

Then you specify in the individual project settings which .lib files to link in. Or you can also link by using the #pragma directive as shown by Kambiz.

The DLLs go into C:\Windows, or into some other folder on the %PATH% environment variable.

Share this post


Link to post
Share on other sites
f001error    122
thanks for the replies mate, How do i add extra paths to the environment variable. I tried path = path + blah and path = path & blah, in a command window but that was rather bad lol.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
In Visual Studion 6, the include and lib search paths can be found:

Tools -> Options -> Directories Tab

To tell the project which libraires to link to, use:

Project Options -> Link Tab, and add to the list of libs.

Put any required DLL's in the same directory as the app, or in the windows system directory - OR add the directory you want them to be in to the environment variables, found here:

Richt click My Computer -> Properties -> Advanced.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this