PDA

View Full Version : Qt, Windows, STL and headaches



DoctorWatson
1st May 2009, 09:59
I'm having quite a time trying to get Qt and Visual C++ to place nice. I have a fully functional windows C++ console app that I want to convert into a Qt GUI app. My app needs to use some Windows libraries, such as setupapi.lib, so it can talk to some hardware.

I tried using Qt Creator first, but MingW complained about files from the Windows SDK (i.e. winnt.h) due to inline assembly, compiler-specific macros and what not. Also, my app using std::wstringstream, which MingW doesn't seem to support.

So I then complied Qt with Visual C++, but now the std::wstringstream problem does not go away. This has lead me to believe that when I execute the following,



C:\Project> qmake
C:\Project> nmake


The make file generated by qmake seems to be point Microsoft's nmake to the MingW version of the STL libraries. Unfortunately I'm not quite savvy enough with Qt to know how to get it to stop doing that.

Has anyone run into this problem before? Any ideas?

fullmetalcoder
1st May 2009, 10:18
Should be as simple as specifying the proper mkspec e.g :

qmake -spec win32-msvc

Quick list of mkspec you may try to work with MSVC :


win32-msvc
win32-msvc.net
win32-msvc2002
win32-msvc2003
win32-msvc2005
win32-msvc2008

Note that you can find the valid mkspec names in the mkspecs directory of your Qt installation.