<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Niels,<BR> <BR>Thanks for your example. It works well on my PC. So there should be something wrong in my files. I will check and let you know the reason when I find it. <BR> <BR>Best regards and thanks again.<BR>Yanming<BR><br> <BR><div><div id="SkyDrivePlaceholder"></div>> Date: Wed, 20 Feb 2013 15:36:21 +0100<br>> From: niels_dekker_address_until_2014@xs4all.nl<br>> To: cmake@cmake.org<br>> Subject: Re: [CMake] Remove _MBCS<br>> <br>> <br>> On 2013-02-18 10:00, YanmingZou wrote:<br>> > I am developing an application on windows with VS2012 and CMake<br>> > (2.8.10.2). I want to use unicode in my program, so I add UNICODE and<br>> > _UNICODE with ADD_DEFINITIONS. However, there is always a _MBCS marco in<br>> > the generated project file. The project can be compiled, but I am not<br>> > happy with that. Could someone can tell me how to remove the _MBCS?<br>> <br>> On 2013-02-20 14:35, Patrick Johnmeyer wrote:<br>> > Did you try remove_definitions?<br>> <br>> <br>> Still I'm surprised that in your case, add_definitions(-D_UNICODE) does <br>> not automatically remove the definition of _MBCS. Do you even have _MBCS <br>> for a simple CMakeLists.txt as follows?<br>> <br>> ############################################################<br>> # CMakeLists.txt<br>> project( MyCMakeMfcUnicodeApp )<br>> cmake_minimum_required(VERSION 2.8)<br>> set(CMAKE_MFC_FLAG 2)<br>> add_definitions(-D_UNICODE)<br>> add_executable(${PROJECT_NAME} MySourceFile.cpp)<br>> ############################################################<br>> <br>> Having the following "MySourceFile.cpp":<br>> <br>> ////////////////////////////////////////////////////////////<br>> // MySourceFile.cpp<br>> #ifdef _MBCS<br>> # error "_MBCS should not be defined!"<br>> #endif<br>> ////////////////////////////////////////////////////////////<br>> <br>> <br>> Kind regards,<br>> <br>> Niels<br>> -- <br>> Niels Dekker<br>> http://www.xs4all.nl/~nd/dekkerware<br>> Scientific programmer at LKEB, Leiden University Medical Center<br>> --<br>> <br>> Powered by www.kitware.com<br>> <br>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>> <br>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br>> <br>> Follow this link to subscribe/unsubscribe:<br>> http://www.cmake.org/mailman/listinfo/cmake<br></div>                                            </div></body>
</html>