Solved

#define _UNICODE

Posted on 2000-04-13
12
787 Views
Last Modified: 2013-11-20
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..
0
Comment
Question by:lar_jens
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 2711711
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
 
LVL 1

Author Comment

by:lar_jens
ID: 2711788
??? But, I thought that MFC took care of the entry point in the CWinApp class..
0
 
LVL 1

Author Comment

by:lar_jens
ID: 2711926
??? But, I thought that MFC took care of the entry point in the CWinApp class..
0
 
LVL 1

Author Comment

by:lar_jens
ID: 2713075
See text above...

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

None, I think...
0
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
ID: 2713316
0
 
LVL 1

Expert Comment

by:nv3prasad
ID: 2713696
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 32

Expert Comment

by:jhance
ID: 2714332
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
 
LVL 1

Author Comment

by:lar_jens
ID: 2714898
I really don't know which one of you deserves the points..
0
 
LVL 1

Author Comment

by:lar_jens
ID: 2714902
I have decided to give jhance the points since he was first with the solution....
0
 
LVL 1

Author Comment

by:lar_jens
ID: 2714906
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
 
LVL 1

Expert Comment

by:nv3prasad
ID: 2716339
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
 
LVL 32

Expert Comment

by:jhance
ID: 2716397
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 55
Whole sheet autoscrub still needed 19 48
Path of Workbook 3 59
"Black Box" Testing of Control System Software 2 17
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now