Linkage error in Visual C++ 6.0

Started by
10 comments, last by yi1ect 17 years, 4 months ago
What is the best way to determine what libraries are missing from Linkage errors. For instance, I'm having these errors, but can't figure out what libraries I may be missing: Linking... main.obj : error LNK2001: unresolved external symbol "public: __thiscall Actor::Actor(void)" (??0Actor@@QAE@XZ) main.obj : error LNK2001: unresolved external symbol "public: __thiscall Adventure::Adventure(void)" (??0Adventure@@QAE@XZ) main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall AdventureInterface::playGame(void)" (?playGame@AdventureInterface@@QAE_NXZ) main.obj : error LNK2001: unresolved external symbol "public: __thiscall AdventureInterface::AdventureInterface(void)" (??0AdventureInterface@@QAE@XZ) main.obj : error LNK2001: unresolved external symbol "public: __thiscall Actor::Actor(int,int,int,int,int,int)" (??0Actor@@QAE@HHHHHH@Z) main.obj : error LNK2001: unresolved external symbol "public: __thiscall Actor::Actor(class Actor const &)" (??0Actor@@QAE@ABV0@@Z) Debug/main.exe : fatal error LNK1120: 6 unresolved externals Error executing link.exe.
Advertisement
Have you defined what the functions at all? Try typing in "#include <w/e>" in all the files.
Check to make sure that you have written the implementations for these functions. So for example if yr class declaration is in a header file, then in the Cpp file declare all of teh functions that are unresolved.

You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts

Also make sure that the the file(s) containing the functions (if you actually implemented them) are in the project.

BTW, you really really really must trash VC++ 6.0. There are only a handful of people in the world that can justify using it. There are several compilers out available that are much better and are even FREE. If you like Visual Studio, try Visual C++ 2005 Express Edition.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Quote:Original post by JohnBolton
BTW, you really really really must trash VC++ 6.0. There are only a handful of people in the world that can justify using it.
.

I think that VC++ 6.0 is one of the best compilers for beginners. VC 2005 gives you a lot of atomated tools, but its designed to speed up the software creation of professional programmers. Also VC++ 6 opens up much faster, and its less cluttered, nice & simple.

You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts

Quote:Original post by VanillaSnake21
Quote:Original post by JohnBolton
BTW, you really really really must trash VC++ 6.0. There are only a handful of people in the world that can justify using it.
.

I think that VC++ 6.0 is one of the best compilers for beginners. VC 2005 gives you a lot of atomated tools, but its designed to speed up the software creation of professional programmers. Also VC++ 6 opens up much faster, and its less cluttered, nice & simple.

No way. 6.0 is non-standards complient, cannot debug nearly as well as 2005 (see: stl debugging), and is, all in all, just horribly broken. If someone is serious about programming then they would be well suited learning VS2005, not shooting themselves in the foot with 6.0.
For the problem at hand the compiler tells you that the class function is not implemented any where in code try finding out which header file the it's declared in and doing a search on the header file if you did not write it
Bring more Pain
Quote:Original post by JohnBolton
BTW, you really really really must trash VC++ 6.0. There are only a handful of people in the world that can justify using it.
.
QFT
Quote:Original post by VanillaSnake21
I think that VC++ 6.0 is one of the best compilers for beginners. VC 2005 gives you a lot of atomated tools, but its designed to speed up the software creation of professional programmers. Also VC++ 6 opens up much faster, and its less cluttered, nice & simple.

you're fired.
This space for rent.
Since its C++, another possibility is that the libraries aren't missing. They could be there, but built with a different version of the compiler than what you are using. Linker symbols in MSVC have changed at least once that I'm aware of (it was either from MSVC 5 -> MSVC 6, or MSVC 6 -> MSVC 7, I don't recall, it was awhile ago), and there could have been more changes in later versions. Since you're asking about what libs you're missing, I'm guessing you're using some 3rd party code, maybe from a pre-built binary package.

Otherwise, I suggest youl look at what headers you're including (clearly it gets past the complier stage, so you have the headers) and try to deduce what .cpp files might go with them (if its code you wrote) or what library they belong to (if its code from someone else). Hopefully you have some idea what code you're using in your project !

If you have a working .exe that uses your library (maybe a demo that came with it) you can use DUMPBIN to see what its linking to and what symbols its pulling in from each one. You can also try to run cl.exe with the option to save preprocessor output and see if that gives you any clues, in case you have a library that includes a library that includes a library, a few levels deep and you're still getting your bearings.

*edit*

In other words, there's no good way to figure out where undefined symbols are coming from. You have to have some knowledge about the code you're using and how its structured, at least enough to recognize the symbols and know what they belong to.
Thanks for the various suggestions.

The functions are actually defined and the headers are also all included.
I'll dig more into the codes with all your sugegtions. The code was written by someone else with another version of C++.

I'll also try the ver 2005.
Thanks.

This topic is closed to new replies.

Advertisement