• Advertisement
Sign in to follow this  

MEH! ...problem with LINKING...plz help

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

Hi everyone, sorry, but I'm new to C++ and I can never seem to understand where/what my problem is when it comes to LINKING errors... Could somone please tell me WHAT this kind of error is? Also, I have the following errors, so please give me any suggestions as to what it may be... NOTE: I'm trying to make a Tetris clone...
Linking...
main.obj : error LNK2001: unresolved external symbol "public: __thiscall BitMapObject::BitMapObject(void)" (??0BitMapObject@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall BitMapObject::~BitMapObject(void)" (??1BitMapObject@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall BitMapObject::operator struct HDC__ *(void)" (??BBitMapObject@@QAEPAUHDC__@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall BitMapObject::Load(struct HDC__ *,char const *)" (?Load@BitMapObject@@QAEXPAUHDC__@@PBD@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall BitMapObject::Create(struct HDC__ *,int,int)" (?Create@BitMapObject@@QAEXPAUHDC__@@HH@Z)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/main.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

main.exe - 7 error(s), 0 warning(s)

Share this post


Link to post
Share on other sites
Advertisement
forgot to add...

I'm using Visual Studio 6 (VC++) and made project with Win32 Application (blank template)

...if that helps any...

Share this post


Link to post
Share on other sites
The first five erros seem to indicate that you declared a class and didn't add the class member function definitions to the project. The sixth error indicates that you either are creating a console project and didn't define your main() function, or you are writing a window application and accidently created a console project instead. If the latter problem go your project settings, and linker options and change the subsystem from console to winodws. If the first, create a main() function.

Share this post


Link to post
Share on other sites
A linker error of this sort (undefined symbol) indicates that you are making calls to a function for which no function body has been defined.

From the log you posted (which by the way you should post between source tags... see forum FAQ for this), you have declared in .h files but not defined in .c/.cpp files the following in the BitMapObject class:

- the constructor
- the destructor
- an overloaded operator
- Load()
- Create()

If these already exist in a source file, the likelihood is that you have not included this source file in your Visual Studio project.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement