[Qt-creator] DEFINES += _UNICODE

Alexander Rukletsov rukletsov at gmail.com
Tue Mar 6 18:56:27 CET 2012


Hi Duane,

it seems that your project is not cross-platform. I suppose that TCHAR is
defined only in windows headers and is not a part of standard C++. Think of
it like as a language extension provided by visual studio compiler.

Hope that helps,
Alex

On 6 March 2012 14:36, Duane <duane.hebert at group-upc.com> wrote:

> 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.
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20120306/4e27f7ff/attachment.html>


More information about the Qt-creator mailing list