How to compile Qt 5.8 statically with PostgreSQL plugin in VS2015

北战南征 提交于 2021-01-27 17:39:55

问题


Can anybody who may have any idea compiling Qt 5.8 Open Source statically with PostgreSQL support on Windows. I tried all the options known to me including the below. I'm using qt 5.8 sources on Windows 10 x64.

configure -opensource -confirm-license -debug-and-release -static -platform win32-msvc2015 -nomake examples -nomake tests -sql-psql PSQL_LIBS="C:\PSQL\9.6\lib\libpq.lib" -I C:\PSQL\9.6\include\libpq -I C:\PSQL\9.6\include -L C:\PSQL\9.6\lib\libpq.lib

After running the config above, I seem to be getting the below:

Note: Using static linking will disable the use of dynamically loaded plugins. Make sure to import all needed static plugins, or compile needed modules into the library. ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed. Check config.log for details.

Am I missing something here?


回答1:


That worked for me while building Qt 5.9.1

configure -prefix <your parameters> ^
PSQL_LIBS="D:\PostgreSQL\9.6\lib\libpq.lib" ^
-I D:\PostgreSQL\9.6\include ^
-L D:\PostgreSQL\9.6\lib


来源:https://stackoverflow.com/questions/42897652/how-to-compile-qt-5-8-statically-with-postgresql-plugin-in-vs2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!