I'm trying to link against the QPid Proton library, using static libs, and am getting lots of link errors. I am able to build with the shared libraries, but for this project we need to use static libs.
Here's the CMake file:
cmake_minimum_required(VERSION 3.0.0)
project(test-qpid VERSION 0.1.0)
include(CTest)
enable_testing()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie " )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v -std=c++17 -lpthread -static-libgcc -static-libstdc++ -fdiagnostics-color=auto")
set(THREADS_PREFER_PTHREAD_FLAG ON)
add_library(libpthread STATIC IMPORTED)
set_target_properties(libpthread PROPERTIES IMPORTED_LOCATION /usr/lib/x86_64-linux-gnu/libpthread.a)
set_target_properties(libpthread PROPERTIES INTERFACE_INCLUDE_DIRECTORIES /usr/include)
add_executable(test-qpid main.cpp)
find_library(QPID_PROTON_CORE NAMES qpid-proton-core-static)
if (NOT QPID_PROTON_CORE)
message(FATAL_ERROR, "QPid Proton core static library not found")
endif()
find_library(QPID_PROTON_PROACTOR NAMES qpid-proton-proactor-static)
if (NOT QPID_PROTON_PROACTOR)
message(FATAL_ERROR, "QPid Proton proactor static library not found")
endif()
find_library(QPID_PROTON NAMES qpid-proton-static)
if (NOT QPID_PROTON)
message(FATAL_ERROR, "QPid Proton static library not found")
endif()
find_library(QPID_PROTON_CPP NAMES qpid-proton-cpp-static)
if (NOT QPID_PROTON_CPP)
message(FATAL_ERROR, "QPid Proton CPP static library not found")
endif()
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include_directories("/usr/local/include")
set(LIBS ${QPID_PROTON_CORE} ${QPID_PROTON} ${QPID_PROTON_PROACTOR} ${QPID_PROTON_CPP})
target_link_libraries(test-qpid ${LIBS} libpthread)
include(CPack)
Here is a snippet of the output I'm seeing (there are lots more, which I've omitted for brevity):
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lpthread CMakeFiles/test-qpid.dir/main.cpp.o /usr/local/lib/libqpid-proton-core-static.a /usr/local/lib/libqpid-proton-static.a /usr/local/lib/libqpid-proton-proactor-static.a /usr/local/lib/libqpid-proton-cpp-static.a /usr/lib/x86_64-linux-gnu/libpthread.a -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtend.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::close()':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:65: undefined reference to `pn_connection_close'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::error() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:171: undefined reference to `pn_connection_remote_condition'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::transport() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:52: undefined reference to `pn_connection_transport'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::open(proton::connection_options const&)':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:61: undefined reference to `pn_connection_open'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::virtual_host[abi:cxx11]() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:71: undefined reference to `pn_connection_remote_hostname'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::container_id[abi:cxx11]() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:75: undefined reference to `pn_connection_remote_container'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::user[abi:cxx11]() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:79: undefined reference to `pn_connection_transport'
[build] /usr/bin/ld: /home/user/src/qpid-proton/cpp/src/connection.cpp:79: undefined reference to `pn_transport_get_user'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::sessions() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:93: undefined reference to `pn_session_head'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::receivers() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:97: undefined reference to `pn_link_head'
[build] /usr/bin/ld: /home/user/src/qpid-proton/cpp/src/connection.cpp:101: undefined reference to `pn_link_next'
[build] /usr/bin/ld: /home/user/src/qpid-proton/cpp/src/connection.cpp:99: undefined reference to `pn_link_is_receiver'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::senders() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:107: undefined reference to `pn_link_head'
[build] /usr/bin/ld: /home/user/src/qpid-proton/cpp/src/connection.cpp:111: undefined reference to `pn_link_next'
[build] /usr/bin/ld: /home/user/src/qpid-proton/cpp/src/connection.cpp:109: undefined reference to `pn_link_is_sender'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::open_session(proton::session_options const&)':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:121: undefined reference to `pn_session'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::default_session()':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:133: undefined reference to `pn_session'
[build] /usr/bin/ld: /home/user/src/qpid-proton/cpp/src/connection.cpp:134: undefined reference to `pn_session_open'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::max_frame_size() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:175: undefined reference to `pn_connection_transport'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::max_sessions() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:179: undefined reference to `pn_connection_transport'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::idle_timeout() const':
[build] /home/user/src/qpid-proton/cpp/src/connection.cpp:183: undefined reference to `pn_connection_transport'
[build] /usr/bin/ld: /usr/local/lib/libqpid-proton-cpp-static.a(connection.cpp.o): in function `proton::connection::desired_capabilities() const':
I've been Googling for answers for days and have gotten nowhere. If anyone has any experience with QPid Proton I'd greatly appreciate some suggestions.
Related
I was working on a QT program including libtorch and opencv which was compiling without any error in my previous Ubuntu 21.04.
The libtorch library locates at /home/user/Downloads/libtorch and OpenCV installed with the following command:
apt install python3-opencv libopencv-dev libdc1394-22-dev
After upgrading my OS to Ubuntu jammy (22.04), building that program returns the following errors:
warning: libicui18n.so.67, needed by /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3, not found (try using -rpath or -rpath-link)
warning: libicuuc.so.67, needed by /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3, not found (try using -rpath or -rpath-link)
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_getDSTSavings_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_setMillis_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_strcoll_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_open_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `u_strToUpper_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_getTimeZoneDisplayName_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `uenum_close_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_getSortKey_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_get_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_getDefaultTimeZone_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_openTimeZones_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_close_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `u_strToLower_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `uenum_next_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_close_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_setAttribute_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_inDaylightTime_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_clone_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_open_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_openTimeZoneIDEnumeration_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_openCountryTimeZones_67'
error: collect2: error: ld returned 1 exit status
error: [CMakeFiles/example.dir/build.make:234: bina] Error 1
CMakeLists.txt is as following code:
cmake_minimum_required(VERSION 3.5)
project(example LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PREFIX_PATH /home/user/Downloads/libtorch)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets LinguistTools REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools REQUIRED)
find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
set(TS_FILES example_en_US.ts)
set(PROJECT_SOURCES
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
torchtestdlg.cpp
classification.cpp
${TS_FILES}
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(example
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
else()
if(ANDROID)
add_library(example SHARED
${PROJECT_SOURCES}
)
else()
add_executable(example
${PROJECT_SOURCES}
)
endif()
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
endif()
target_link_libraries(example PRIVATE Qt${QT_VERSION_MAJOR}::Widgets ${TORCH_LIBRARIES} ${OpenCV_LIBS})
Obviously it means that it has unresolved symbols which I couldn't understand what symbols they are.
I'm a little bit new in the Qt world, so maybe this question is very simple, but I do not know how to solve it.
I have installed the qt libraries using the version 5.11.1 available in this link. For configuring the installation I used this command:
./configure -static -developer-build -opensource -confirm-license -platform linux-g++ -qt-zlib -qt-libjpeg -qt-pcre -qt-libpng -qt-freetype -nomake examples -nomake tests -opengl desktop -qt-xcb -prefix /usr/local/Qt5.11.1
And after doing all the stuff for the static compilation (basically creating a kit for that) I'm getting some errors during the building step. Here they are:
/usr/local/Qt5.11.3/plugins/platforms/libqwayland-egl.a(moc_qwaylandeglwindow.o):(.data.rel.ro._ZTVN15QtWaylandClient17QWaylandEglWindowE[_ZTVN15QtWaylandClient17QWaylandEglWindowE]+0x178): undefined reference to `QPlatformWindow::initialize()'
/usr/local/Qt5.11.3/plugins/platforms/libqwayland-xcomposite-egl.a(qwaylandxcompositeeglwindow.o):(.data.rel.ro._ZTVN15QtWaylandClient27QWaylandXCompositeEGLWindowE[_ZTVN15QtWaylandClient27QWaylandXCompositeEGLWindowE]+0x168): undefined reference to `QPlatformWindow::initialize()'
/usrMakefile:1521: recipe for target 'build/release/VMTK-Neuro4.0' failed
/local/Qt5.11.3/plugins/platforms/libqwayland-xcomposite-glx.a(qwaylandxcompositeglxwindow.o):(.data.rel.ro._ZTVN15QtWaylandClient27QWaylandXCompositeGLXWindowE[_ZTVN15QtWaylandClient27QWaylandXCompositeGLXWindowE]+0x168): undefined reference to `QPlatformWindow::initialize()'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-egl-integration.a(qxcbeglwindow.o):(.data.rel.ro._ZTV13QXcbEglWindow[_ZTV13QXcbEglWindow]+0xd0): undefined reference to `QXcbWindow::setWindowState(QFlags<Qt::WindowState>)'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-egl-integration.a(qxcbeglwindow.o):(.data.rel.ro._ZTV13QXcbEglWindow[_ZTV13QXcbEglWindow]+0x160): undefined reference to `QXcbWindow::startSystemMove(QPoint const&)'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-egl-integration.a(qxcbeglwindow.o):(.data.rel.ro._ZTV13QXcbEglWindow[_ZTV13QXcbEglWindow]+0x1d8): undefined reference to `QPlatformWindow::initialize()'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-egl-integration.a(qxcbeglwindow.o):(.data.rel.ro._ZTV13QXcbEglWindow[_ZTV13QXcbEglWindow]+0x218): undefined reference to `non-virtual thunk to QXcbWindow::setWindowState(QFlags<Qt::WindowState>)'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-egl-integration.a(qxcbeglwindow.o):(.data.rel.ro._ZTV13QXcbEglWindow[_ZTV13QXcbEglWindow]+0x2e8): undefined reference to `non-virtual thunk to QXcbWindow::startSystemMove(QPoint const&)'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-glx-integration.a(qxcbglxwindow.o):(.data.rel.ro._ZTV13QXcbGlxWindow[_ZTV13QXcbGlxWindow]+0xd0): undefined reference to `QXcbWindow::setWindowState(QFlags<Qt::WindowState>)'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-glx-integration.a(qxcbglxwindow.o):(.data.rel.ro._ZTV13QXcbGlxWindow[_ZTV13QXcbGlxWindow]+0x160): undefined reference to `QXcbWindow::startSystemMove(QPoint const&)'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-glx-integration.a(qxcbglxwindow.o):(.data.rel.ro._ZTV13QXcbGlxWindow[_ZTV13QXcbGlxWindow]+0x1d8): undefined reference to `QPlatformWindow::initialize()'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-glx-integration.a(qxcbglxwindow.o):(.data.rel.ro._ZTV13QXcbGlxWindow[_ZTV13QXcbGlxWindow]+0x218): undefined reference to `non-virtual thunk to QXcbWindow::setWindowState(QFlags<Qt::WindowState>)'
/usr/local/Qt5.11.3/plugins/xcbglintegrations/libqxcb-glx-integration.a(qxcbglxwindow.o):(.data.rel.ro._ZTV13QXcbGlxWindow[_ZTV13QXcbGlxWindow]+0x2e8): undefined reference to `non-virtual thunk to QXcbWindow::startSystemMove(QPoint const&)'
/usr/local/Qt5.11.3/lib/libQt5GlxSupport.a(qglxconvenience.o): In function `qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat*, _XDisplay*, __GLXFBConfigRec*, int)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/glxconvenience/qglxconvenience.cpp:308: undefined reference to `QSurfaceFormat::setColorSpace(QSurfaceFormat::ColorSpace)'
/usr/local/Qt5.11.3/lib/libQt5GlxSupport.a(qglxconvenience.o): In function `qglx_surfaceFormatFromVisualInfo(QSurfaceFormat*, _XDisplay*, XVisualInfo*, int)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/glxconvenience/qglxconvenience.cpp:347: undefined reference to `QSurfaceFormat::setColorSpace(QSurfaceFormat::ColorSpace)'
/usr/local/Qt5.11.3/lib/libQt5GlxSupport.a(qglxconvenience.o): In function `qglx_reduceFormat(QSurfaceFormat*)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/glxconvenience/qglxconvenience.cpp:416: undefined reference to `QSurfaceFormat::colorSpace() const'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/glxconvenience/qglxconvenience.cpp:417: undefined reference to `QSurfaceFormat::setColorSpace(QSurfaceFormat::ColorSpace)'
/usr/local/Qt5.11.3/lib/libQt5GlxSupport.a(qglxconvenience.o): In function `qglx_buildSpec(QSurfaceFormat const&, int, int)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/glxconvenience/qglxconvenience.cpp:123: undefined reference to `QSurfaceFormat::colorSpace() const'
/usr/local/Qt5.11.3/lib/libQt5GlxSupport.a(qglxconvenience.o): In function `qglx_findConfig(_XDisplay*, int, QSurfaceFormat, bool, int, int)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/glxconvenience/qglxconvenience.cpp:213: undefined reference to `QSurfaceFormat::colorSpace() const'
/usr/local/Qt5.11.3/plugins/imageformats/libqgif.a(qgifhandler.o): In function `QGIFFormat::decode(QImage*, unsigned char const*, int, int*, int*)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/plugins/imageformats/gif/qgifhandler.cpp:358: undefined reference to `QImage::sizeInBytes() const'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/plugins/imageformats/gif/qgifhandler.cpp:423: undefined reference to `QImage::sizeInBytes() const'
/usr/local/Qt5.11.3/plugins/imageformats/libqwebp.a(qwebphandler.o): In function `QWebpHandler::read(QImage*)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtimageformats/src/plugins/imageformats/webp/qwebphandler.cpp:179: undefined reference to `QImage::sizeInBytes() const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-emu-integration.a(qeglfsemulatorintegration.o):(.data.rel.ro._ZTV25QEglFSEmulatorIntegration[_ZTV25QEglFSEmulatorIntegration]+0x118): undefined reference to `QEglFSDeviceIntegration::platformFunction(QByteArray const&) const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-emu-integration.a(qeglfsemulatorintegration.o):(.data.rel.ro._ZTV25QEglFSEmulatorIntegration[_ZTV25QEglFSEmulatorIntegration]+0x120): undefined reference to `QEglFSDeviceIntegration::nativeResourceForIntegration(QByteArray const&)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-emu-integration.a(qeglfsemulatorintegration.o):(.data.rel.ro._ZTV25QEglFSEmulatorIntegration[_ZTV25QEglFSEmulatorIntegration]+0x128): undefined reference to `QEglFSDeviceIntegration::nativeResourceForScreen(QByteArray const&, QScreen*)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldeviceintegration.o):(.data.rel.ro._ZTV29QEglFSKmsEglDeviceIntegration[_ZTV29QEglFSKmsEglDeviceIntegration]+0x118): undefined reference to `QEglFSDeviceIntegration::platformFunction(QByteArray const&) const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldeviceintegration.o):(.data.rel.ro._ZTV29QEglFSKmsEglDeviceIntegration[_ZTV29QEglFSKmsEglDeviceIntegration]+0x120): undefined reference to `QEglFSKmsIntegration::nativeResourceForIntegration(QByteArray const&)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldeviceintegration.o):(.data.rel.ro._ZTV29QEglFSKmsEglDeviceIntegration[_ZTV29QEglFSKmsEglDeviceIntegration]+0x128): undefined reference to `QEglFSKmsIntegration::nativeResourceForScreen(QByteArray const&, QScreen*)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldeviceintegration.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceWindow[_ZTV24QEglFSKmsEglDeviceWindow]+0x30): undefined reference to `QPlatformWindow::initialize()'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldeviceintegration.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceWindow[_ZTV24QEglFSKmsEglDeviceWindow]+0x70): undefined reference to `QPlatformWindow::setWindowState(QFlags<Qt::WindowState>)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldeviceintegration.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceWindow[_ZTV24QEglFSKmsEglDeviceWindow]+0x140): undefined reference to `QPlatformWindow::startSystemMove(QPoint const&)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldevicescreen.o): In function `QEglFSKmsEglDeviceScreen::QEglFSKmsEglDeviceScreen(QKmsDevice*, QKmsOutput const&)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp:51: undefined reference to `QEglFSKmsScreen::QEglFSKmsScreen(QKmsDevice*, QKmsOutput const&, bool)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldevicescreen.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceScreen[_ZTV24QEglFSKmsEglDeviceScreen]+0xa0): undefined reference to `QEglFSKmsScreen::manufacturer() const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldevicescreen.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceScreen[_ZTV24QEglFSKmsEglDeviceScreen]+0xa8): undefined reference to `QEglFSKmsScreen::model() const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldevicescreen.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceScreen[_ZTV24QEglFSKmsEglDeviceScreen]+0xb0): undefined reference to `QEglFSKmsScreen::serialNumber() const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldevicescreen.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceScreen[_ZTV24QEglFSKmsEglDeviceScreen]+0xd8): undefined reference to `QEglFSKmsScreen::modes() const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldevicescreen.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceScreen[_ZTV24QEglFSKmsEglDeviceScreen]+0xe0): undefined reference to `QEglFSKmsScreen::currentMode() const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a(qeglfskmsegldevicescreen.o):(.data.rel.ro._ZTV24QEglFSKmsEglDeviceScreen[_ZTV24QEglFSKmsEglDeviceScreen]+0xe8): undefined reference to `QEglFSKmsScreen::preferredMode() const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-x11-integration.a(qeglfsx11integration.o):(.data.rel.ro._ZTV20QEglFSX11Integration[_ZTV20QEglFSX11Integration]+0x118): undefined reference to `QEglFSDeviceIntegration::platformFunction(QByteArray const&) const'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-x11-integration.a(qeglfsx11integration.o):(.data.rel.ro._ZTV20QEglFSX11Integration[_ZTV20QEglFSX11Integration]+0x120): undefined reference to `QEglFSDeviceIntegration::nativeResourceForIntegration(QByteArray const&)'
/usr/local/Qt5.11.3/plugins/egldeviceintegrations/libqeglfs-x11-integration.a(qeglfsx11integration.o):(.data.rel.ro._ZTV20QEglFSX11Integration[_ZTV20QEglFSX11Integration]+0x128): undefined reference to `QEglFSDeviceIntegration::nativeResourceForScreen(QByteArray const&, QScreen*)'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandshmbackingstore.o): In function `QtWaylandClient::QWaylandShmBackingStore::resize(QSize const&)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandshmbackingstore.cpp:293: undefined reference to `QImage::sizeInBytes() const'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandshmbackingstore.cpp:295: undefined reference to `QImage::sizeInBytes() const'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandshmbackingstore.cpp:296: undefined reference to `QImage::sizeInBytes() const'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandshmbackingstore.o): In function `QtWaylandClient::QWaylandShmBuffer::~QWaylandShmBuffer()':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandshmbackingstore.cpp:122: undefined reference to `QImage::sizeInBytes() const'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandshmbackingstore.o):(.data.rel.ro._ZTVN15QtWaylandClient23QWaylandShmBackingStoreE[_ZTVN15QtWaylandClient23QWaylandShmBackingStoreE]+0x30): undefined reference to `QPlatformBackingStore::composeAndFlush(QWindow*, QRegion const&, QPoint const&, QPlatformTextureList*, bool)'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandwindow.o): In function `QtWaylandClient::QWaylandWindow::setCanResize(bool)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandwindow.cpp:487: undefined reference to `void QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::DefaultDelivery>(QWindow*, QRect const&)'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandwindow.o): In function `QtWaylandClient::QWaylandWindow::handleScreenChanged()':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandwindow.cpp:929: undefined reference to `void QWindowSystemInterface::handleWindowScreenChanged<QWindowSystemInterface::DefaultDelivery>(QWindow*, QScreen*)'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandwindow.o): In function `QtWaylandClient::QWaylandWindow::setWindowStateInternal(QFlags<Qt::WindowState>)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandwindow.cpp:1018: undefined reference to `void QWindowSystemInterface::handleWindowStateChanged<QWindowSystemInterface::DefaultDelivery>(QWindow*, QFlags<Qt::WindowState>, int)'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandwindow.o): In function `QtWaylandClient::QWaylandWindow::initWindow()':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandwindow.cpp:209: undefined reference to `QWindow::windowStates() const'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandwindow.o): In function `QtWaylandClient::QWaylandWindow::setGeometry(QRect const&)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandwindow.cpp:343: undefined reference to `void QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::DefaultDelivery>(QWindow*, QRect const&)'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandshmwindow.o):(.data.rel.ro._ZTVN15QtWaylandClient17QWaylandShmWindowE[_ZTVN15QtWaylandClient17QWaylandShmWindowE]+0x170): undefined reference to `QPlatformWindow::initialize()'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandcursor.o): In function `QtWaylandClient::QWaylandCursor::cursorBitmapImage(QCursor const*)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtwayland/src/client/qwaylandcursor.cpp:122: undefined reference to `QImage::sizeInBytes() const'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandcursor.o):(.data.rel.ro._ZTVN15QtWaylandClient14QWaylandCursorE[_ZTVN15QtWaylandClient14QWaylandCursorE]+0x80): undefined reference to `QPlatformCursor::setOverrideCursor(QCursor const&)'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(qwaylandcursor.o):(.data.rel.ro._ZTVN15QtWaylandClient14QWaylandCursorE[_ZTVN15QtWaylandClient14QWaylandCursorE]+0x88): undefined reference to `QPlatformCursor::clearOverrideCursor()'
/usr/local/Qt5.11.3/lib/libQt5WaylandClient.a(moc_qwaylandwindow_p.o):(.data.rel.ro._ZTVN15QtWaylandClient14QWaylandWindowE[_ZTVN15QtWaylandClient14QWaylandWindowE]+0x168): undefined reference to `QPlatformWindow::initialize()'
/usr/local/Qt5.11.3/lib/libqtfreetype.a(ftgzip.o): In function `ft_gzip_file_init':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:307: undefined reference to `z_inflateInit2_'
/usr/local/Qt5.11.3/lib/libqtfreetype.a(ftgzip.o): In function `ft_gzip_file_done':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:322: undefined reference to `z_inflateEnd'
/usr/local/Qt5.11.3/lib/libqtfreetype.a(ftgzip.o): In function `ft_gzip_file_reset':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:351: undefined reference to `z_inflateReset'
/usr/local/Qt5.11.3/lib/libqtfreetype.a(ftgzip.o): In function `ft_gzip_file_fill_output':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:431: undefined reference to `z_inflate'
/usr/local/Qt5.11.3/lib/libqtfreetype.a(ftgzip.o): In function `FT_Gzip_Uncompress':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:737: undefined reference to `z_inflateInit2_'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:741: undefined reference to `z_inflate'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:744: undefined reference to `z_inflateEnd'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/freetype/src/gzip/ftgzip.c:752: undefined reference to `z_inflateEnd'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(qgenericunixthemes.o): In function `QGnomeTheme::gtkFontName() const':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp:789: undefined reference to `QString::arg(QLatin1String, int, QChar) const'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(qdbusplatformmenu.o): In function `QDBusPlatformMenu::QDBusPlatformMenu()':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp:168: undefined reference to `QPlatformMenu::QPlatformMenu()'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(qdbusplatformmenu.o): In function `QDBusPlatformMenuItem::QDBusPlatformMenuItem()':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp:62: undefined reference to `QPlatformMenuItem::QPlatformMenuItem()'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(qdbustraytypes.o): In function `iconToQXdgDBusImageVector(QIcon const&)':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/platformsupport/themes/genericunix/dbustray/qdbustraytypes.cpp:107: undefined reference to `QImage::sizeInBytes() const'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(moc_qdbusplatformmenu_p.o):(.data.rel.ro._ZTV21QDBusPlatformMenuItem[_ZTV21QDBusPlatformMenuItem]+0x70): undefined reference to `QPlatformMenuItem::setTag(unsigned long long)'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(moc_qdbusplatformmenu_p.o):(.data.rel.ro._ZTV21QDBusPlatformMenuItem[_ZTV21QDBusPlatformMenuItem]+0x78): undefined reference to `QPlatformMenuItem::tag() const'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(moc_qdbusplatformmenu_p.o):(.data.rel.ro._ZTV17QDBusPlatformMenu[_ZTV17QDBusPlatformMenu]+0x90): undefined reference to `QPlatformMenu::setTag(unsigned long long)'
/usr/local/Qt5.11.3/lib/libQt5ThemeSupport.a(moc_qdbusplatformmenu_p.o):(.data.rel.ro._ZTV17QDBusPlatformMenu[_ZTV17QDBusPlatformMenu]+0x98): undefined reference to `QPlatformMenu::tag() const'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(png.o): In function `png_compare_ICC_profile_with_sRGB':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/png.c:2368: undefined reference to `z_adler32'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/png.c:2369: undefined reference to `z_adler32'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/png.c:2381: undefined reference to `z_crc32'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/png.c:2382: undefined reference to `z_crc32'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(png.o): In function `png_reset_crc':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/png.c:130: undefined reference to `z_crc32'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(png.o): In function `png_calculate_crc':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/png.c:173: undefined reference to `z_crc32'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(png.o): In function `png_reset_zstream':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/png.c:986: undefined reference to `z_inflateReset'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngread.o): In function `png_read_destroy':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngread.c:979: undefined reference to `z_inflateEnd'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngrutil.o): In function `png_inflate_claim':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngrutil.c:407: undefined reference to `z_inflateReset2'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngrutil.c:416: undefined reference to `z_inflateInit2_'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngrutil.c:429: undefined reference to `z_inflateValidate'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngrutil.o): In function `png_zlib_inflate':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngrutil.c:467: undefined reference to `z_inflate'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngrutil.o): In function `png_decompress_chunk':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngrutil.c:662: undefined reference to `z_inflateReset'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngwrite.o): In function `png_write_destroy':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngwrite.c:945: undefined reference to `z_deflateEnd'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngwutil.o): In function `png_deflate_claim':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngwutil.c:395: undefined reference to `z_deflateEnd'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngwutil.c:413: undefined reference to `z_deflateReset'
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngwutil.c:417: undefined reference to `z_deflateInit2_'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngwutil.o): In function `png_text_compress':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngwutil.c:580: undefined reference to `z_deflate'
/usr/local/Qt5.11.3/lib/libqtlibpng.a(pngwutil.o): In function `png_compress_IDAT':
/home/everaldo/Downloads/qt-everywhere-src-5.11.3/qtbase/src/3rdparty/libpng/pngwutil.c:981: undefined reference to `z_deflate'
collect2: error: ld returned 1 exit status
make: *** [build/release/VMTK-Neuro4.0] Error 1
16:39:32: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project VMTK-DTI_2.0 (kit: Qt 5.11.3 Static GCC (C++, x86 64bit in /usr/bin) )
When executing step "Make"
I looked in all the internet for a way to solve thoses linking errors, but I didn't find the libraries I'm missing. In this project I also use the glew, glm and gdcm libraries.
So, how can I solve thoses errors? Thanks.
I don't recomemnd to use use '-prefix' with '-developer-build' options together. I can see in attached output that Qt was installed to /usr/local? Or is it used as developer-build directly from source code?
Use only one of these settings. Or you can try adjust the location of Qt installation via qt.conf (not sure if this work for developer-builds too; but works smooth for relocated qt tree)
I am working on a project under Windows and Ubuntu using CMake and CLang. On Ubuntu, I can build it OK with a shell script and could build it using Qt 5.5.1 (Creator 3.5.1). After upgrading to Qt 5.14.0 (Creator 4.11.1), there are over 1200 link errors where doctest cannot be found.
Captured compiler output:
[8/9 4.4/sec] Linking CXX executable test/test_runner
FAILED: : && /opt/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang-9 -g -O0 -Wall -pthread --verbose test/CMakeFiles/test_runner.dir/test_runner.cpp.o test/CMakeFiles/test_runner.dir/test.cpp.o -o test/test_runner PSCOM_LIB.a && :
clang version 9.0.0 (https://github.com/llvm-mirror/llvm c62b24f070c9a4bb1a76409e623042a740cac4cd)
Target: x86_64-unknown-linux-gnu
...
"/usr/bin/ld" -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test/test_runner /usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7.4.0/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/7.4.0 -L/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../.. -L/opt/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/../lib -L/lib -L/usr/lib test/CMakeFiles/test_runner.dir/test_runner.cpp.o test/CMakeFiles/test_runner.dir/test.cpp.o PSCOM_LIB.a -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/7.4.0/crtend.o /usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu/crtn.o
test/CMakeFiles/test_runner.dir/test_runner.cpp.o: In function `doctest::detail::rawMemoryToString(void const*, unsigned int)':
/home/me/dev/source/vcpkg_pml/vcpkg/installed/x64-linux/include/doctest/doctest.h:2853: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'
/home/me/dev/source/vcpkg_pml/vcpkg/installed/x64-linux/include/doctest/doctest.h:2854: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/home/me/dev/source/vcpkg_pml/vcpkg/installed/x64-linux/include/doctest/doctest.h:2854: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::_Setfill<char>)'
/home/me/dev/source/vcpkg_pml/vcpkg/installed/x64-linux/include/doctest/doctest.h:2854: undefined reference to `std::ostream::operator<<(std::ios_base& (*)(std::ios_base&))'
/home/me/dev/source/vcpkg_pml/vcpkg/installed/x64-linux/include/doctest/doctest.h:2856: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::_Setw)'
/home/me/dev/source/vcpkg_pml/vcpkg/installed/x64-linux/include/doctest/doctest.h:2856: undefined reference to `std::ostream::operator<<(unsigned int)'
and hundreds of similar errors in several files.
The shell script produces the following output.
"/usr/bin/ld" ... -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc ...
I have no idea why -lstdc++ is added or not but assume that it identifies the required doctest library. Is there an option that can be added to CMakeList.txt to correct this issue?
i tried to build qt 5.7.1 on pi3 following this instruction:
https://wiki.qt.io/Native_Build_of_Qt_5.4.1_on_a_Raspberry_Pi
the source package i use is:
qt-everywhere-opensource-src-5.7.1.tar
configure as:
./configure -v -opengl es2 -force-pkg-config -device linux-rpi3-g++ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -qt-xcb -make libs -no-use-gold-linker -prefix /usr/local/qt5
The instruction is using "linux-rasp-pi-g++", but i think it should be linux-rpi3-g++ for Rpi3.
Make, and i get errors like:
/usr/bin/g++ -Wl,-rpath-link,/opt/vc/lib
-Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/lib/arm-linux-gnueabihf -mfloat-abi=hard -Wl,--gc-sections -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../lib -Wl,-rpath-link,/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib
-Wl,-rpath-link,/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/lib
-o ../../bin/qmltestrunner .obj/main.o -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib
-lQt5QuickTest -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/lib -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Test -lQt5Core -lGLESv2 -lpthread /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV8Engine::toVariant(QV4::ValueRef, int)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlProfilerService::dataReady(QQmlAbstractProfilerAdapter*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::ExecutionContext::throwTypeError()'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::markObjects(QV4::Managed*, QV4::ExecutionEngine*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlEngineDebugService::instance()'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV8Engine::fromVariant(QVariant const&)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::PersistentValue::operator=(unsigned long long)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlValueType::qt_metacast(char const*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickItem::y() const#Qt_5'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::errors() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Managed::engine() const'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::ExecutionEngine::newErrorObject(QV4::ValueRef)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlBinding::property() const'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlCustomParser::bindingIdentifier(QV4::CompiledData::Binding
const*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined
reference to QV4::ExecutionContext::throwError(QString const&)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlBinding::Invalid' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5:
undefined reference to QQmlAbstractBinding::vTables'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::ExecutionContext::throwError(QV4::ValueRef)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::call(QV4::Managed*, QV4::CallData*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlBinding::createBinding(int, QObject*, QQmlContext*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Managed::operator new(unsigned int, QV4::MemoryManager*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::height() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::setLookup(QV4::Managed*, QV4::Lookup*, QV4::ValueRef)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::PersistentValue::PersistentValue(QV4::ValueRef)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlValueType::qt_metacall(QMetaObject::Call, int, void**)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlProfilerService::addGlobalProfiler(QQmlAbstractProfilerAdapter*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickView::QQuickView(QWindow*)#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::putIndexed(QV4::Managed*, unsigned int, QV4::ValueRef)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::put(QV4::Managed*, QV4::StringRef, QV4::ValueRef)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::Object(QV4::ExecutionEngine*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlValueType::staticMetaObject'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QShortcutMap::tryShortcutEvent(QObject*, QKeyEvent*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlProfilerService::instance()'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::engine() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::getLookup(QV4::Managed*, QV4::Lookup*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::setSource(QUrl const&)#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::PersistentValue::operator=(QV4::ValueRef)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::ArrayData::realloc(QV4::Object*, QV4::ArrayData::Type, unsigned
int, unsigned int, bool)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlInspectorService::addView(QObject*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlPropertyPrivate::setBinding(QQmlProperty const&,
QQmlAbstractBinding*, QFlags)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlComponentPrivate::initializeObjectWithInitialProperties(QV4::ValueRef,
QV4::ValueRef, QObject*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::staticMetaObject#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlValueType::QQmlValueType(int, QObject*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::x() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlDebugStream::QQmlDebugStream(QByteArray*,
QFlags<QIODevice::OpenModeFlag>)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::window() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::~Object()'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::mapToScene(QPointF const&)
const#Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined
reference to QV4::Object::deleteProperty(QV4::Managed*,
QV4::StringRef)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::rootContext() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::getIndexed(QV4::Managed*, unsigned int, bool*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlDebugService::isDebuggingEnabled()'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::destroy(QV4::Managed*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickWindow::grabWindow()#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlValueType::metaObject() const'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlAbstractBinding::weakPointer()'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::get(QV4::Managed*, QV4::StringRef, bool*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QOpenGLContextPrivate::globalShareContext()'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Managed::setVTable(QV4::ManagedVTable const*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlEngineDebugService::setStatesDelegate(QQmlDebugStatesDelegate*)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickView::status() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::construct(QV4::Managed*, QV4::CallData*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QQmlInspectorService::instance()'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::query(QV4::Managed const*, QV4::StringRef)'
/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickItem::width() const#Qt_5'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::defineAccessorProperty(QV4::StringRef, unsigned long
long ()(QV4::CallContext), unsigned long long
()(QV4::CallContext))'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::Object::advanceIterator(QV4::Managed*, QV4::ObjectIterator*,
QV4::StringRef, unsigned int*, QV4::Property*,
QV4::PropertyAttributes*)'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
QV4::String::simplifyString() const'
/usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
`QQmlInspectorService::removeView(QObject*)' collect2: error: ld
returned 1 exit status Makefile:108: recipe for target
'../../bin/qmltestrunner' failed make[3]: *
[../../bin/qmltestrunner] Error 1 make[3]: Leaving directory
'/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/tools/qmltestrunner'
Makefile:276: recipe for target 'sub-qmltestrunner-make_first' failed
make[2]: * [sub-qmltestrunner-make_first] Error 2
so, how can i fix this problem?
thanks.
I've solved this problem, and there is a new problem now.
Before native building qt on pi, I installed qt by:
sudo apt-get install qt5-default, and other qt5 packages.
Although I have :
sudo apt-get remove those packages, it may still works.
so I formatted the SD card and re-burned an Raspbian image, followed the instructions, "make", and the problem is gone.
but now I have another problem.
When I "make install", I get this error:
/usr/bin/g++ -Wl,-rpath-link,/opt/vc/lib -Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/lib/arm-linux-gnueabihf -mfloat-abi=hard -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../../lib -shared -o libdeclarative_location.so .obj/location.o .obj/qdeclarativegeomapitemview.o .obj/qdeclarativegeoserviceprovider.o .obj/qdeclarativegeocodemodel.o .obj/qdeclarativegeoroutemodel.o .obj/qdeclarativegeoroute.o .obj/qdeclarativegeoroutesegment.o .obj/qdeclarativegeomaneuver.o .obj/qdeclarativegeomap.o .obj/qdeclarativegeomaptype.o .obj/qdeclarativegeomapitembase.o .obj/qdeclarativegeomapquickitem.o .obj/qdeclarativecirclemapitem.o .obj/qdeclarativerectanglemapitem.o .obj/qdeclarativepolygonmapitem.o .obj/qdeclarativepolylinemapitem.o .obj/qdeclarativeroutemapitem.o .obj/qgeomapitemgeometry.o .obj/qdeclarativegeomapcopyrightsnotice.o .obj/error_messages.o .obj/locationvaluetypehelper.o .obj/qquickgeomapgesturearea.o .obj/qquickgeocoordinateanimation.o .obj/mapitemviewdelegateincubator.o .obj/qdeclarativeplacecontentmodel.o .obj/qdeclarativesupportedcategoriesmodel.o .obj/qdeclarativesearchsuggestionmodel.o .obj/qdeclarativesearchresultmodel.o .obj/qdeclarativereviewmodel.o .obj/qdeclarativeplaceimagemodel.o .obj/qdeclarativeplaceeditorialmodel.o .obj/qdeclarativecontactdetail.o .obj/qdeclarativecategory.o .obj/qdeclarativeplace.o .obj/qdeclarativeplaceattribute.o .obj/qdeclarativeplaceicon.o .obj/qdeclarativeplaceuser.o .obj/qdeclarativeratings.o .obj/qdeclarativesupplier.o .obj/qdeclarativesearchmodelbase.o .obj/moc_qdeclarativecirclemapitem_p.o .obj/moc_qdeclarativerectanglemapitem_p.o .obj/moc_qdeclarativepolygonmapitem_p.o .obj/moc_qdeclarativepolylinemapitem_p.o .obj/moc_qdeclarativeroutemapitem_p.o .obj/moc_qdeclarativegeomapcopyrightsnotice_p.o .obj/moc_qquickgeocoordinateanimation_p.o .obj/moc_qdeclarativeplacecontentmodel.o .obj/moc_qdeclarativesupportedcategoriesmodel_p.o .obj/moc_qdeclarativesearchsuggestionmodel_p.o .obj/moc_qdeclarativesearchresultmodel_p.o .obj/moc_qdeclarativereviewmodel_p.o .obj/moc_qdeclarativeplaceimagemodel_p.o .obj/moc_qdeclarativeplaceeditorialmodel.o .obj/moc_qdeclarativecontactdetail_p.o .obj/moc_qdeclarativecategory_p.o .obj/moc_qdeclarativeplace_p.o .obj/moc_qdeclarativeplaceattribute_p.o .obj/moc_qdeclarativeplaceicon_p.o .obj/moc_qdeclarativeplaceuser_p.o .obj/moc_qdeclarativeratings_p.o .obj/moc_qdeclarativesupplier_p.o .obj/moc_qdeclarativesearchmodelbase.o -L=/opt/vc/lib -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/lib -lQt5Location -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/lib -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Positioning -lQt5Core -Wl,-rpath-link,/opt/vc/lib -lGLESv2 -lpthread -lclip2tri -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/lib -lpoly2tri -lclipper
/usr/bin/ld: cannot find -lclip2tri
/usr/bin/ld: cannot find -lpoly2tri
/usr/bin/ld: cannot find -lclipper
collect2: error: ld returned 1 exit status
Makefile:273: recipe for target '../../../qml/QtLocation/libdeclarative_location.so' failed
make[4]: *** [../../../qml/QtLocation/libdeclarative_location.so] Error 1
make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/imports/location'
Makefile:80: recipe for target 'sub-location-install_subtargets' failed
make[3]: *** [sub-location-install_subtargets] Error 2
make[3]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/imports'
Makefile:135: recipe for target 'sub-imports-install_subtargets' failed
make[2]: *** [sub-imports-install_subtargets] Error 2
make[2]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src'
Makefile:56: recipe for target 'sub-src-install_subtargets' failed
make[1]: *** [sub-src-install_subtargets] Error 2
make[1]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation'
Makefile:844: recipe for target 'module-qtlocation-install_subtargets' failed
make: *** [module-qtlocation-install_subtargets] Error 2
I found there are 3 directories in qtlocation/src/3rdparty
clip2tri
clipper
poly2tri
and 3 file in qtlocation/lib:
libclip2tri.prl
libclipper.prl
libpoly2tri.prl
but no lib files.
I checked the build log, it seems cpp file in the directoriy qtlocation/src/3rdparty are not compiled,
cd 3rdparty/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/3rdparty.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
make[3]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty'
cd poly2tri/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/poly2tri/poly2tri.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
make[4]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/poly2tri'
make[4]: Nothing to be done for 'install'.
make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/poly2tri'
cd clipper/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clipper/clipper.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
make[4]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clipper'
make[4]: Nothing to be done for 'install'.
make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clipper'
cd clip2tri/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clip2tri/clip2tri.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
make[4]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clip2tri'
make[4]: Nothing to be done for 'install'.
make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clip2tri'
make[3]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty'
cd location/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/location/location.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
make[3]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/location'
I am trying to compile the PCL tutorial described here and I am facing these linking errors.
Linking CXX executable pcl_visualizer usr/lib/libpq.so.5: undefined
reference to SSL_get_peer_certificate#OPENSSL_1.0.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFReadDirectory#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined
reference to CRYPTO_num_locks#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference to
SSL_CTX_use_certificate_chain_file#OPENSSL_1.0.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFIsTiled#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined reference to
SSL_use_certificate_file#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference to ENGINE_free#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference toOPENSSL_config#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference to SSL_get_error#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to
SSL_use_PrivateKey_file#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference to X509_STORE_load_locations#OPENSSL_1.0.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFDefaultStripSize#LIBTIFF_4.0' usr/lib/libvtkIO.so.5.8.0:
undefined reference to TIFFReadTile#LIBTIFF_4.0' usr/lib/libpq.so.5:
undefined reference toSSL_set_ex_data#OPENSSL_1.0.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFWriteScanline#LIBTIFF_4.0' usr/lib/libvtkIO.so.5.8.0: undefined
reference to_TIFFfree#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined
reference to SSL_read#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0:
undefined reference toTIFFGetField#LIBTIFF_4.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFScanlineSize#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined reference
toX509_STORE_set_flags#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference to SSLv23_method#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference toENGINE_load_private_key#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to
X509_get_subject_name#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference toCRYPTO_set_id_callback#OPENSSL_1.0.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFClose#LIBTIFF_4.0' usr/lib/libvtkIO.so.5.8.0: undefined reference
toTIFFClientOpen#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined
reference to SSL_CTX_new#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference toSSL_CTX_get_cert_store#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to
SSL_check_private_key#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0:
undefined reference toTIFFGetFieldDefaulted#LIBTIFF_4.0'
usr/lib/libpq.so.5: undefined reference to
ENGINE_by_id#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0: undefined
reference toTIFFNumberOfDirectories#LIBTIFF_4.0' usr/lib/libpq.so.5:
undefined reference to ERR_get_error#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to
CRYPTO_set_locking_callback#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference to SSL_load_error_strings#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference toSSL_new#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to
X509_NAME_get_text_by_NID#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0:
undefined reference toTIFFOpen#LIBTIFF_4.0' usr/lib/libpq.so.5:
undefined reference to SSL_write#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference toX509_free#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference to SSL_CTX_load_verify_locations#OPENSSL_1.0.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFReadRGBAImage#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined
reference to SSL_free#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference toSSL_ctrl#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0:
undefined reference to TIFFSetField#LIBTIFF_4.0' usr/lib/libpq.so.5:
undefined reference toSSL_set_verify#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to ENGINE_init#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference toSSL_set_fd#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to SSL_connect#OPENSSL_1.0.0'
usr/lib/libpq.so.5: undefined reference to
ERR_reason_error_string#OPENSSL_1.0.0' usr/lib/libpq.so.5: undefined
reference to SSL_CTX_ctrl#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference toSSL_pending#OPENSSL_1.0.0' usr/lib/libpq.so.5:
undefined reference to SSL_use_PrivateKey#OPENSSL_1.0.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
TIFFSetWarningHandler#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined
reference to ENGINE_finish#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0:
undefined reference toTIFFSetErrorHandler#LIBTIFF_4.0'
usr/lib/libvtkIO.so.5.8.0: undefined reference to
_TIFFmalloc#LIBTIFF_4.0' usr/lib/libpq.so.5: undefined reference to
SSL_library_init#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0: undefined
reference to TIFFSetDirectory#LIBTIFF_4.0' usr/lib/libvtkIO.so.5.8.0:
undefined reference toTIFFReadScanline#LIBTIFF_4.0'
usr/lib/libpq.so.5: undefined reference to
SSL_shutdown#OPENSSL_1.0.0' usr/lib/libvtkIO.so.5.8.0: undefined
reference toTIFFNumberOfTiles#LIBTIFF_4.0' collect2: error: ld
returned 1 exit status make[2]: * [pcl_visualizer] Error 1 make1:
* [CMakeFiles/pcl_visualizer.dir/all] Error 2 make: *** [all] Error 2
The CmakeList file is define as follow:
cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
project (pcl-visualizer)
find_package (Qt4 REQUIRED)
find_package (VTK REQUIRED)
find_package (PCL 1.7.1 REQUIRED)
include_directories (${PCL_INCLUDE_DIRS})
link_directories (${PCL_LIBRARY_DIRS})
add_definitions (${PCL_DEFINITIONS})
set (project_SOURCES main.cpp pclviewer.cpp)
set (project_HEADERS pclviewer.h)
set (project_FORMS pclviewer.ui)
set (VTK_LIBRARIES vtkRendering vtkGraphics vtkHybrid QVTK)
QT4_WRAP_CPP (project_HEADERS_MOC ${project_HEADERS})
QT4_WRAP_UI (project_FORMS_HEADERS ${project_FORMS})
INCLUDE (${QT_USE_FILE})
ADD_DEFINITIONS (${QT_DEFINITIONS})
ADD_EXECUTABLE (pcl_visualizer ${project_SOURCES}
${project_FORMS_HEADERS}
${project_HEADERS_MOC})
TARGET_LINK_LIBRARIES (pcl_visualizer ${QT_LIBRARIES} ${PCL_LIBRARIES} ${VTK_LIBRARIES})
Is there anything missing in the CMakeList file?
The PostgreSQL library you are linking to is missing openssl, you can check it with
ldd /usr/lib/libpq.so.5
it should report something like
libssl.so.1.0.0 => not found
The same with vtk, but it doesn't find a valid TIFF library.
First, check that you have both openssl and tiff libraries installed, if linking still fails, check if versions are correct.
Second, if all libraries are installed, check if are from the correct architecture (all 32-bit or all 64-bit).
Third, manually force your project to load libraries flags (both from command line CMAKE_MODULE_LINKER_FLAGS / CMAKE_SHARED_LINKER_FLAGS or in the target_link_libraries directive).
As mentioned in the comments, anaconda is the problem.
Rename your anaconda folder to anaconda-temp so that the link in your path variable is incorrect for cmake during its scan. Then install qt5-default using sudo apt-get install qt5-default as that solved both the errors in my case. Then rerun cmake and now it should detect qt5 in the correct location (i.e. not in the anaconda path).
Now run make and then finally you can rename anaconda-temp to anaconda so that it corresponds to your path and the value in bashrc and it's business as usual.
For solving problem with TIFF 4.0 you may try
cd $HOME/Downloads
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/t/tiff3/libtiff4_3.9.7-2ubuntu1_amd64.deb
sudo dpkg -i libtiff4_3.9.7-2ubuntu1_amd64.deb
sudo ldconfig
It works for me that you should remove the ananconda3 from your system path. For me, I just remove it from the ~/.bashrc file. And everything works ok.