Qt - 4.7.3 - How to make static build

前端 未结 2 1274
陌清茗
陌清茗 2020-12-11 13:48

I used 4.7.2 for the past months. Now I downloaded 4.7.3. Now I am searching to type \"configure -static\". But I don\'t know where the hell \"the qt path\". Can anybody she

2条回答
  •  無奈伤痛
    2020-12-11 14:24

    Some tips that result from my experience, and add a bit more to the answer of rubenv:

    • Pass the install directory as a flag of the configure; be sure to choose a different directory from the one where you have stored a non-static version of Qt!
    • Some modules will likely cause you troubles when compiling statically because you need to resolve the dependencies statically; one example is webkit, so if you don't need it be sure to disable it
    • It is generally not a good idea to build the debug symbols into a static library, so I normally debug with the dynamic version, and use the static Qt to generate releases only.

    Therefore, my configure looks something like this:

    configure -static -prefix C:\Qt\4.8.6_static -no-webkit -release
    

提交回复
热议问题