PDA

View Full Version : "Treat wchar_t as Built-in Type" to "yes" link error



sungaoyong
5th June 2008, 08:34
I am a new Qt user. I am having a issue on a project When using QString::fromWCharArray.my Qt version is 4.4.0
vs2005 gives the following link error:
error LNK2019: unresolved external symbol "__declspec(dllimport)
public: static class QString __cdecl QString::fromWCharArray(wchar_t const *,int)"
(__imp_?fromWCharArray@QString@@SA?AV1@PB_WH@Z) referenced in function "public:
void __thiscall midiIO::queryMidiInDevices(void)" (?queryMidiInDevices@midiIO@@QAEXXZ)

i see the topic http://www.qtcentre.org/forum/f-qt-programming-2/t-wchar-to-qstring-giving-error-in-vs2005-4625.html

I am linking into my Qt VS2005 project that have the compiled with "Treat wchar_t as Built-in Type" set to "Yes". my Third party libraries (FDO http://fdo.osgeo.org) need to built this way.

my Qt VS2005 project build fine with qt version 3.3.1,but use qt 4.4.0 have this issues.

How do I use Qt's QString::fromWCharArray(4.4.0) with libaries built with "Yes" for "Treat wchar_t as Built-in Type"?

ChristianEhrlicher
5th June 2008, 11:45
You have to compile your project and qt with this option too.
For Qt you have to modify QMAKE_CFLAGS in qt4/mkspecs/msvc2005/qmake.conf and then recompile your complete Qt