0

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:

C:\Qt\5.12.5\Src 
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\

On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql

Finally I have added c:\pgsql to user Path

Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.

Next, set the env path for this PowerShell session: $env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)

After that, I execute configure.bat like that:

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

But I have get this error:

ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.

Searching in config.log I can read those lines:

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

What can I do or what is the properly way to do that? Thank you in advance.

UPDATE

There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.

I want to compile it under mingw.

The solution suggested by @Soheil Armin doesn´t work too The solution suggested by @Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work. Also, the ^ character can be saved:

configure <your parameters> 
PSQL_LIBS="C:\pgsql\lib\libpq.a" 
-I "C:\pgsql\include" 
-L "C:\pgsql\lib"
1

1 Answer 1

2

You need to explicitly define library paths of Postgres.

configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"
Sign up to request clarification or add additional context in comments.

5 Comments

Thank you, but It doesn´t work for me. But I can see I haven´t libpq.lib, only libpq.a and libpq.dll. I´ll update the question
Ok. just use libpq.a as you are using mingw. Don't forget to clean configuration before retry: git submodule foreach --recursive "git clean -dfx"
Thank you again. It doesn´t work too. I haven´ t dowlnloaded source from Git...do I need any cleanup of configure even? If yes, how could I do it?
You can make/nmake distclean but sometime it does not work. It's better to remove the whole directory and extract it again from the archive.
Solved. The worst is that I have had to reinstall the sources each time I was wrong. It took me a long time. If not, a new configure didnt't work. The distclean doesn' t work too. Also, is not necesary write "^" symbol in the string of options. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.