Sign in to follow this  

Linkage error in Visual C++ 6.0

This topic is 4020 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

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.

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Quote:

I think that VC++ 6.0 is one of the best compilers for beginners.

Yes, what beginners need is a compiler that throws up over correct code... [wink]

Quote:

VC 2005 gives you a lot of atomated tools, but its designed to speed up the software creation of professional programmers.

And also to follow the C++ standard.

Share this post


Link to post
Share on other sites
just to go back onto the problem - if you haven't initialised a pointer then that could give a error. it has happened before in vc++ 6 to me and i couldn't figure out what it was - even the simplest of mistakes can give unexpected results sometimes.

also make sure the cpp files for Actor and Adventure are correctly implement - check the function prototype and that you have it assigned to the proper class such as:

Actor::doThis() {
}

Adventure::doThat(){
}


Share this post


Link to post
Share on other sites

This topic is 4020 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.

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