-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static linking is not working, C++20, libpq REL_16_2, #822
Comments
A very similar issue was reported, but the cause could not be determined: #820 Does the same problem occur when compiling with other versions of GCC or with Clang? |
@adastreamer you're using libpqxx straight from its build directory, without installing it... Did you add the Without that, the app build won't be able to find libpqxx's configuration header. |
Yes, tried different versions and standards |
I do a static build, could you please list the .a/.so libs which describe the missing symbols? And yes, of course, cmake includes directories automatically, but I also tried to pick manually the following directories:
|
Anyway, I will double check one more time and provide results if I do not missing anything |
Note these two details though:
|
I will check and let you know. |
Thanks. |
The issue was related to cmake configuration, especially in regards to the linking stage. Seems like it's not been automatically set in the right order if app consists of multiple libraries. I wrote a simple Makefile and recompiled everything step by step, linked manually, everything seems working. Sorry for disturbing you. |
Glad it's resolved @adastreamer . |
In #828 we found that the real problem was a bad command line: in that case the compilation was done with |
Hello, here is what I'm getting linking the static library.
System: Debian
Docker image gcc:13.2 (pre-installed libpq is uninstalled to process build from scratch)
Build command I use:
./configure --disable-documentation CXXFLAGS="-std=c++20 -fPIC -O3 -I/app/vendor/postgres/src/interfaces/libpq" --with-postgres-lib=/app/vendor/postgres/src/interfaces/libpq --with-postgres-include=/app/vendor/postgres/src/include --disable-shared --enable-static && make
Then trying to link using CMake with my program:
Building and linking via CMake's
add_subdirectory
produces the same result.Tried to rebuild using different flags and not using
fPIC
- the same result.Does anyone have ideas what is this problem about?
The text was updated successfully, but these errors were encountered: