#define _UNICODE

If I use the preprocessor definition _UNICODE, I can't compile..

I get the following error message:

libcmtd.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16


WHY?? It works great then _UNICODE is not defined..
LVL 1
lar_jensAsked:
Who is Participating?
 
jkrCommented:
When compiling a Win32 GUI app using UNICODE, the entry point has to be

int PASCAL  wWinMain    (   HANDLE  hInstance,
                            HANDLE  hPrevInstance,
                            LPCTSTR lpszCmdLine,
                            int     nCmdShow
                        )
{
 // ...
}

instead of 'WinMain()'...

BTW: Be sure to also

#define UNICODE

without the prepending underscore...
0
 
lar_jensAuthor Commented:
??? But, I thought that MFC took care of the entry point in the CWinApp class..
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
lar_jensAuthor Commented:
??? But, I thought that MFC took care of the entry point in the CWinApp class..
0
 
lar_jensAuthor Commented:
See text above...

When developing COM objects, the _UNICODE label is defined.. What is the difference between _UNICODE and UNICODE?

None, I think...
0
 
nv3prasadCommented:
Step 1:
Open the "Project Settings" Dialog

Step 2:
Go to the Link Tab and select category as "Output" from the combo box.

Step 3:
"In the Entry-point symbol:" type the following

wWinMainCRTStartup

This should solve your link problems.

nv3prasad
 
0
 
jhanceCommented:
nv3prasd,

BRILLIANT!!!  Oh man, you're such a genius!  You were able to follow the URL that I posted and copy the information out of it and post it here as YOUR answer!  Oh gosh, where would we be without your wisdom and insight!
0
 
lar_jensAuthor Commented:
I really don't know which one of you deserves the points..
0
 
lar_jensAuthor Commented:
I have decided to give jhance the points since he was first with the solution....
0
 
lar_jensAuthor Commented:
Thanks man.. Now I know that the
CString::GetLength() function returns the number of CHARACTERS in a string. Not the number of BYTES as stated in the MSDN documentation...

0
 
nv3prasadCommented:
Dear jhance,

"BRILLIANT!!!  Oh man, you're such a genius!  You were able to follow the URL that I posted and copy the information out of it and post it here as YOUR answer!  Oh gosh, where would we be without your wisdom and insight!"

The above is an understatement, I had this problem, so I exactly knew the point, so I just provided the solution.

I apprecitae his selection of your answer since you had posted a URL before my explanation. But being an expert you should learn to respect and understand other people.

nv3prasad
0
 
jhanceCommented:
nv3...,

Being an expert yourself you should know better than to post an answer which duplicates another posting already on the question.  If you don't have the time or incliation to review the history, post it as a comment.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.