[Qt-creator] DEFINES += _UNICODE

Duane duane.hebert at group-upc.com
Tue Mar 6 14:36:08 CET 2012


I have a project using Qt/Windows using Visual Studio that I'm porting 
to Linux using Qt Creator.  I dumped the project in Windows to a qt .pro 
file to start.  This usually works to get things going.

I have a modbus library that uses wchar_t*.  In windows, we have UNICODE 
defined and use TCHAR*.  It works fine.

When porting this to Linux, I was getting unresolved externs on some 
functions using TCHAR.  I noticed that exporting the project added 
DEFINES += _UNICODE to my pro file so I thought that this was what I 
wanted.  After several failed attempts to fix this, I commented out the 
define for _UNICODE.  I was hoping to get a better idea of the error. 
But what happened is that it compiled, built and works.

Why?  Is _UNICODE only needed on Windows and does it break something on 
Linux?

Thanks.




More information about the Qt-creator mailing list