Recommended Posts

Hi, i'm using VC++ 6 and want to link a library to my programm thats not in the compiler's directory. I searched the help section but couldn't find an answer. thanks

Share on other sites
You'll have to add the library's path to VC's library search path. I don't remember how to do it, though. Look for an option with a name like "Directories".

Share on other sites
It's been a while since I've used VC6 but it something like Tools->Options->Directories.

Once you have the right page you'll need to change the drop down option to "library files", you can then add a new search path for the lib files.

Share on other sites
Thanks, it's working. But I still get 2 unresolved errors.
Is it possible that the linker uses the library in his native directory rather then mine(which have the same name)? I'm trying to link ddraw.lib to my project...

anyone ?

Share on other sites
Put the link right at the top, cuase it seems your using directx. If you dont put it at the top youre basically saying use directx3.0

Share on other sites
Remember to include the libraries you are using in your projects settings.

Share on other sites
blackbox.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Release/freakout.exe : fatal error LNK1120: 2 unresolved externals

This is the error. I've included ddraw.lib only.
A problem seems to be that in both directorys, the default one and the one I've added contains a ddraw.lib.

Share on other sites
Quote:
 Original post by QuakLIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

generally this comes from having the project settings be for a console app, but you're actually coding a windows app. if you have a WinMain in your program you need to change the settings (don't remember how) such that the project knows it's a windows app. if you have neither a main nor a winmain you need one or the program won't know how to run.

-me

Share on other sites
I have a WinMain() and it is a win32 app.

Share on other sites
Quote:
 Original post by Quakand it is a win32 app.

not if it's complaining about "unresolved symbol _main"

make sure in your linker properties that subsystem is set to windows, not console.

-me

Share on other sites
Shame on me you were right ;(
But there is still this error:
blackbox.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
Release/freakout.exe : fatal error LNK1120: 1 unresolved externals

any idea?

Share on other sites
Try manually adding the required lib file to your project as you would a cpp or header file. It will automatically be linked into your game and at least this way you can be sure the lib file you are using is the one you want.

Share on other sites
try:

#pragma comment(lib, "C:/PATH_TO_THE_LIB/ddraw.lib")

of course the best thing is to just put the lib into you "lib" folder, i think directX is always backwards compatible so you only stand to gain from that.

Share on other sites
Looks like youre going thru tricks of the game programming gurus by the look of the files...

Just follow his example, check your code if you typed it in manually and follow his instructions for setting up vc++ in the appendix.

Which btw is an awesome book, excellent choice!

Create an account

Register a new account

• Forum Statistics

• Total Topics
628305
• Total Posts
2981962

• 9
• 12
• 11
• 12
• 11