【发布时间】:2019-10-28 01:36:33
【问题描述】:
我已经通过维护工具 Qt 5.12.5 和源安装。我有下一个目录:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
另一方面,我读到可下载的 Postgres 版本是用 MSVC 编译的,我必须编译自己的版本。我已经按照link 做了,现在我在c:\pgsql 中有一个postgresql 版本
最后我将c:\pgsql添加到用户路径
下一步,我已在管理员模式下打开 PowerShell,我已转到 C:\Qt\5.12.5\Src\。
接下来,为此 PowerShell 会话设置 env 路径:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\"(再次设置pgsql路径....)
之后,我就这样执行configure.bat:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
但是我收到了这个错误:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
在config.log 中搜索我可以阅读这些行:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
我能做什么或正确的方法是什么? 提前谢谢你。
更新
有类似的问题here,但还没有解决,这些问题是关于 Visual Studio 的。
我想在mingw下编译。
@Soheil Armin 建议的解决方案也不起作用
@Soheil Armin 建议的解决方案工作正常,但我需要删除整个源代码树并按照他的建议重新安装它。如果没有,新的配置将不起作用。
另外,^ 字符可以保存:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
【问题讨论】:
标签: postgresql qt compiler-errors