-
Notifications
You must be signed in to change notification settings - Fork 231
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
cmake compile issue #643
Comments
Commit SHA 90768b0 is included in version 7.7.3. |
Exactly. It looks like libns was built with libpqxx 7.6, but the installed libpqxx is a different version. This is a general problem with rich ABIs like you get in C++, and so I generally recommend using libpqxx as a static library rather than as a shared library. |
Hello Jeroen,
Thanks for your help.
I think the problem comes from the line " LIBRARIES_TO_LINK
${PQXX_LIBRARIES}."
I guess NS3 LIBRARIES_TO_LINK macro link as a shared library by default.
Do you know how to link as a static library?
Have a nice day,
Boyang Yan
… Message ID: ***@***.***>
|
libpqxx is a static library unless the Line 69 in 3d97c80
Set +set(BUILD_SHARED_LIBS_TMP ${BUILD_SHARED_LIBS})
+set(BUILD_SHARED_LIBS FALSE)
FetchContent_MakeAvailable(libpqxx)
+set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TMP}) And since there is no +add_library(${your_library_name} ${source_files ...})
+target_link_libraries(${your_library_name} PRIVATE pqxx)
-build_lib(
- #add_link_options(-lpqxx -lpq)
-
- LIBNAME database
- SOURCE_FILES ${source_files}
- HEADER_FILES ${header_files}
- LIBRARIES_TO_LINK ${PQXX_LIBRARIES}
- #LIBRARIES_TO_LINK pqxx pq
-) |
Looks like we're done with this ticket. Thanks once again @tt4g for jumping in so quickly. |
Hello All,
Good day to you.
Currently, I am try to using cmake download and build the libqxx.
But, it is show libns3.37-database-default.so: undefined reference to `pqxx::internal::check_pqxx_version_7_6()
anyone know the reason why? Thanks for your help.
cmake:
ERROR MSG:
The text was updated successfully, but these errors were encountered: