Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- From: Kim Gräsman <kim@xxxxxxxx>
- Date: Fri, 14 Sep 2007 12:35:07 +0000 (UTC)
Hi SQACPP,
I'm trying to understand an error when compiling a C++ form project :
1- Create a C++ win32 console application with the defaults parameters
3- Compile the console application
-> It compile without any error
4- Now Create a C+ Form application with the default parameters when
hNotepad = FindWindow(L"Notepad", 0);
** Now the compiler return errors :
The difference between the two is that the first is a native C++ project, while the second is a managed C++ project.
The latter is a different language, formally called C++/CLI, that targets the .NET platform rather than the native Win32 platform. C++/CLI allows you to mix in native C++ pretty much at will, but using C++/CLI causes your app to depend on the .NET framework.
The reason your C++/CLI project doesn't have user32.lib setup in the linker input is that the .NET framework already provides similar services, and the IDE assumes that you want to prefer those to the older, native ones.
So, either you can use the managed way of doing FindWindow, etc. (in which case you might as well just switch to C#) or you can create a native UI project (MFC, most likely) and have access to the full Win32 API, or you can mix; ..NET for the UI and native C++ for the back-end.
The last alternative is probably the one likely to cause you the most grief with all the switching between native and managed code.
FWIW,
- Kim
.
- Follow-Ups:
- References:
- Prev by Date: Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- Next by Date: Re: /clr:pure doens't compile at release mode with unmanaged functions
- Previous by thread: Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- Next by thread: Re: Error LNK2028 unresolved token / LNK2019 Unrevolved external symbol
- Index(es):
Relevant Pages
|