PDA

View Full Version : Windows 7 QT setup



simonerom
18th November 2011, 14:19
Hello everybody,
I'd really like to do some basic QT programming under Windows 7, in order to evaluate the move from C#/WPF to QT/QML.
Unfortunately, I need to link to a thirdy part dll library, which is compiled with Microsoft toolchain.

So, what is the best way to get a good developmen envoronment based on MS SDK?
In the past, I downloaded QT SDK 1.1, which comes with Mingw toolchain ,then I installed MS SDK and separate QT libraries for VS2008.
In addition I had to recompile QT libraries to have them work with VS 2010 SDK.

In the end, it was not so easy to configure QT Creator to use MS SDK, and I came up with two different versions of QT libraries, which generated lot of confusion...

Please, do you have any suggestion on the correct steps to configure a Microsoft SDK based QT development environment?

Thanks for any help,
Simone.

Lesiok
18th November 2011, 17:24
Download Qt precompiled for VS2008 (http://qt.nokia.com/downloads/windows-cpp-vs2008) and visual-studio-add-in (http://qt.nokia.com/downloads/visual-studio-add-in)

simonerom
18th November 2011, 19:16
Tankyou Lesiok,
I installed the latest QT SDK 1.1.4, then run Update tool: removed MinGW libraries and added QT 4.8.0 RC for VS2010 from Experimental repository.
In addition, I had to install Windows 7 SDK 7.1.
Finally, I got QT Creator ready and set on the 4.8.0 library and Microsoft toolchain for build.

Now, I can build my project, I obtain the executable, but I get the error message:

Failed to start program. Path or permissions wrong?
Starting C:\Users\simone\Documents\Visual Studio 2010\Projects\qt\build\debug\matching.exe...

When I tried to start directly the exe file, I got missing QtGui4.dll and QtCore4.dll (why aren't they copied into the build directory??).
After I put those dlls in place, the program runs perfectly.
If I run it from QT Creator stil have the error as described before...

My .pro file follows:



# matching.pro
#

CONFIG += qt warn_off release

#defines
win32:DEFINES += WIN32

#includes
INCLUDEPATH += "$$(MYLIBROOT)/include"
INCLUDEPATH += "$$(MYLIBROOT)/include/cpp"

#libs
LIBPATH += "$$(MYLIBROOT)/lib/$$(MYLIBARCH)"
unix:LIBS += -lMYLIBcpp -lMYLIB -ldl -lpthread
win32:LIBS += MYLIBcpp.lib MYLIB.lib

#sources
HEADERS += qMYLIBwindow.h
HEADERS += matching.h
SOURCES += qMYLIBwindow.cpp
SOURCES += matching.cpp
SOURCES += main.cpp