Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- From: SQACPP <lsdisciples@xxxxxxxxxxx>
- Date: Fri, 14 Sep 2007 02:46:58 -0700
I'm trying to understand an error when compiling a C++ form project :
Error LNK2028 unresolved token...
Error LNK2019 Unrevolved external symbol ...
Here is how to understand/reproduce my problem with VS2005 :
1- Create a C++ win32 console application with the defaults parameters
2- In the header section add #include <windows.h> and add the
following code in the main() :
HWND hNotepad;
hNotepad = FindWindow(L"Notepad", 0);
3- Compile the console application
-> It compile without any error
4- Now Create a C+ Form application with the default parameters when
creating the new project.
5- In the header section add #include <windows.h> and add the
following code in the main() or somewhere else :
HWND hNotepad;
hNotepad = FindWindow(L"Notepad", 0);
** Now the compiler return errors :
Error error LNK2028: unresolved token (0A00000C) "extern "C" struct
HWND__ * __stdcall FindWindowW(wchar_t const *,wchar_t const *)" (?
FindWindowW@@$$J18YGPAUHWND__@@PB_W0@Z) referenced in function "int
__clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP
$01AP$AAVString@System@@@Z) AutomationWinForm.obj
Error error LNK2019: unresolved external symbol "extern "C" struct
HWND__ * __stdcall FindWindowW(wchar_t const *,wchar_t const *)" (?
FindWindowW@@$$J18YGPAUHWND__@@PB_W0@Z) referenced in function "int
__clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP
$01AP$AAVString@System@@@Z) AutomationWinForm.obj
Why?? How can this can be fixed?
Thanks again!
.
- Follow-Ups:
- Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- From: Kim Gräsman
- Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- From: Igor Tandetnik
- Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- Prev by Date: Vista, “ Privileges ”,“ Ownership ” and “ Permissions ”.
- Next by Date: Re: MSVC 7.1 template issue
- Previous by thread: /clr:pure doens't compile at release mode with unmanaged functions
- Next by thread: Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- Index(es):
Relevant Pages
|