Missing include when compiling QT with Visual Studio 2010

后端 未结 4 993
忘掉有多难
忘掉有多难 2021-02-10 13:23

I try to compile QT 5.0.0 in the command prompt of Visual Studio 2010 on Windows 7, 64bit. The process itself is known and described here and here. On my machine, compilation st

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-10 14:00

    I had the same problem and I finally found the solution (the only difference is that I'm using VS 2008, but I'm using Windows 7, and I needed the 64 bit target as you).

    The main problem is that the compressed file that you download from the Qt site is not ok. You have to use what is in the Git repository (currently version 5.0.1, but not the same as the 5.0.1 version that you get from the downloads page)

    Here is what I did, step by step, exactly:

    prerequisites: have git, perl, python and ruby installed, you have to check your path to see if you can access the executables from anywhere. Search for download links here: http://qt-project.org/wiki/Building-Qt-5-from-Git under "Windows Build environment" section. For Git, download it from here http://git-scm.com

    then do the following:

    go to the directory where you want to install Qt.

    git clone git://gitorious.org/qt/qt5.git qt5
    
    cd qt5
    
    perl init-repository --no-webkit
    
    configure -developer-build -opensource -nomake examples -nomake tests
    

    open a Visual Studio x64 Win64 Command Prompt, look for it or for VS 2008 you can execute: %comspec% /k ""c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64

    inside that window:

    SET CL=/MP
    
    configure -developer-build -opensource -nomake examples -nomake tests -opengl desktop
    

    then press "y" for accepting the licence terms

    nmake
    

    ...and that's all.

    Note to the original question: You asked "How can I properly declare my include?" and after you explained the way you finally solved it: "...I copied the whole folder in which the file resides into a path known to the compiler...".

    Instead of doing that, you might prefer to leave the folder in its original location and do the following before calling nmake:

    SET CL=/Ic:\MyFolder
    

    Note that I used SET CL=/MP before, that's for building faster by using the multiple cores of the processor. So, for that case, you should do:

    SET CL=/MP /Ic:\MyFolder
    

提交回复
热议问题