问题
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