How do I turn off Unicode in a VC++ project?

前端 未结 8 1150
滥情空心
滥情空心 2020-11-27 04:01

I have a VC++ project in Visual Studio 2008.

It is defining the symbols for unicode on the compiler command line (/D \"_UNICODE\" /D \"UNICODE\"), eve

相关标签:
8条回答
  • 2020-11-27 04:27

    None of the above solutions worked for me. But

    #include <Windows.h>
    

    worked fine.

    0 讨论(0)
  • 2020-11-27 04:31

    you can go to project properties --> configuration properties --> General -->Project default and there change the "Character set" from "Unicode" to "Not set".

    0 讨论(0)
  • 2020-11-27 04:34

    For whatever reason, I noticed that setting to unicode for "All Configurations" did not actually apply to all configurations.

    Picture:

    To confirm this, I would open the .vcxproj and confirm the correct token is in all 4 locations. In this photo, I am using unicode. So the string I am looking for is "Unicode". For you, you likely want it to say "MultiByte".

    Picture:

    0 讨论(0)
  • 2020-11-27 04:36

    use #undef UNICODE at the top of your main file.

    0 讨论(0)
  • 2020-11-27 04:47

    From VS2019 Project Properties - Advanced - Advanced Properties - Character Set

    Also if there is _UNICODE;UNICODE Preprocessors Definitions remove them. Project Properties - C/C++ - Preprocessor - Preprocessor Definition

    0 讨论(0)
  • 2020-11-27 04:48

    Have you tried: Project Properties - General - Project Defaults - Character Set?

    See answers in this question for the differences between "Use Multi-Byte Character Set" and "Not Set" options: About the "Character set" option in visual studio 2010

    0 讨论(0)
提交回复
热议问题