Wednesday, December 21, 2011

Qt failed on "configure": on Windows with Visual Studio

When I cloned Qt source code from git, and open a Visual Studio Command Prompt (2010), and went to Qt directory, and run command "configure.exe" to compile the Qt source code, I got the error like something below:
%QTDIR%\src\corelib\global\qglobal.h(62) : fatal error C1083: Cannot open include file: 'QtCore/qconfig.h': No such file or directory...

It's failed on the very beginning when make "qmake". Via process monitor, I verified that actually the qconfig.h has already been created under "%QTDIR%\src\corelib\global\". I have ever compiled the source code from git without any problem. Searched from google, someone mentioned that I need to run "syncqt.bat" from bin folder. syncqt actually is a perl script. Someone replied that don't need to run syncqt.

I tried to install perl, and added perl/bin into my system environment variable path, and then everything works fine. The reason is that "configure.exe" relies on perl script to create the Qt library header structure for development.

Just a clue for anyone who searched related information and come to this page.