We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Linker Error - Unicode

Kalle 2
Kalle 2 asked
on
Medium Priority
305 Views
Last Modified: 2013-11-20
Hi All!
I am writing a program which is going to compile in both
ANSI and UNICODE. It works out Ok in ANSI but when I
compile under _UNICODE I receive this linker error (below).
Can anyone tell me what I am doing wrong?

Best rgds // Anders Karlsson

--------------------Configuration: ControlPanel - Win32 DebugUniCode--------------------
Linking...
msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16

DebugUniCode/ControlPanel.exe : fatal error LNK1120: 1 unresolved externals
Comment
Watch Question

How is your WinMain defined?

Author

Commented:
I skeleton code for my project was provided by the AppWizard.
Where do I look to find my WinMain definition?

// Anders

Commented:
I guess you must have specified the entry point as wWinMainCRTStartup, right? If you use AppWizard to creat the framework, delete it and try again. Please contact me if further questions.

Author

Commented:
No, I have not specified any entry-point at all.
I am building a MFC AppWizard Exe.

// Anders

Commented:
You must include "UNICODE" support during project setup.

Author

Commented:
No, the code is written so that it compiles under both
_UNICODE and ANSI. There is something missing though (library)
when I compile it under _UNICODE.

// Anders
1. _WinMain@16 looks like a C++ mangled name.  Are you using C++?
2. What does your WinMain declaration look like?
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Easy as that, thanks!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.