Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++
I get this some time. but i can't understand what it say
Error 3 error LNK1120: 1 unresolved externals C:\Users\mohammadali1375\documents\visual studio 2010\Projects\MyEngine\MEngine\Debug\MEngine.exe
Error 2 error LNK2001: unresolved external symbol "public: virtual void __thiscall MEngineComponent::Update(void)" (?Update@MEngineComponent@@UAEXXZ) C:\Users\mohammadali1375\documents\visual studio 2010\Projects\MyEngine\MEngine\MEngine\TestComponent.obj
I want to know when does it happen
Posted 29-Dec-12 8:25am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

A couple of things can cause this. You might not have linked correctly to the library file you are trying to use.
Another possibility is that you have declared the function
void Update(void)
in the header file for you MEngineComponent class, but you forgot to actually code the function in the .cpp file. I actually think this would give you the LNK2019 error, but you should double-check to make sure.
If that is not your problem, take a look here for other causes:[^]

Soren Madsen
Espen Harlinn at 29-Dec-12 16:40pm
That's a reasonable explanation :-D
SoMad at 29-Dec-12 17:13pm
Thanks, I am a reasonable man :-). In the article I linked to, there are actually more causes than I expected (and have encountered myself).
Soren Madsen
Sergey Alexandrovich Kryukov at 29-Dec-12 21:47pm
Explained, a 5.
SajeeshCheviry at 2-Jan-13 11:35am
good answer :-)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

A very useful tool that you can use to figure out the exact API that is missing is called 'undname.exe' which is in the \VC\bin directory of your Visual Studio installation (for example, "D:\vs2010\VC\bin\undname.exe" for my VS2010 installation). You can use it to undecorate a name that is generated by the compiler. Here is a sequence that tells you more about the missing API:
[Note that the name flagged in your message above is "?Update@MEngineComponent@@UAEXXZ"]
D:\whatever>cd \vs2010\VC\bin
D:\vs2010\VC\bin>undname ?Update@MEngineComponent@@UAEXXZ
Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation. All rights reserved.
Undecoration of :- "?Update@MEngineComponent@@UAEXXZ"
is :- "public: virtual void __thiscall MEngineComponent::Update(void)"
The cause of the error can be a result of a declaration in a header file that is not implemented, differing parameter list between declaration and definition, mixed definition of linkage (ie. __thiscall, __stdcall etc.), missing export details ("__declspec(dllexport)") or several other things.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 320
1 OriginalGriff 155
2 Peter Leow 115
3 Afzaal Ahmad Zeeshan 114
4 deepakdynamite 110
0 OriginalGriff 7,510
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 5,044
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,514

Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 1 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100