Why is 'UNICODE' being defined?

67 views Asked by At

I have three C++Builder 11 Win32 applications that I have inherited. They all use MBCS and not UNICODE. However, in only one of the 3, UNICODE and MBCS is defined in the debug build only. Of course, this is causing compile errors.

I have checked the project conditional defines and UNICODE is not defined. I have searched all project files and cannot find UNICODE defined anywhere. I am new to Embarcadero, so I hope I am missing something obvious that is causing this. does anyone have an idea of where UNICODE may be getting defined?

1

There are 1 answers

1
Remy Lebeau On

Double check the "_TCHAR maps to" option in your project setup for every build configuration. UNICODE is defined when TCHAR maps to the wchar_t type (which is the default for new projects since 2009, but not for migrated projects that were created pre-2009).

Values of the '_TCHAR maps to' Option:

value meaning
char Substitutes char for _TCHAR.

Note: This option does not float to wide definitions of standard library and API functions.

wchar_t - Substitutes wchar_t for _TCHAR.

- Sets both the UNICODE and _UNICODE macro constants.

- Floats to the wide definitions of standard library and API functions.