3

I am trying to build a program using conan and CMake, but I'm having some issues when linking. CMake doesn't find the libraries provided by conan.

versions

OS: 5.10.68-1-MANJARO x86_64
Conan version: 1.40.1
CMake version: 3.21.3
gcc version: 11.1.0

conan profile

target_host=x86_64-pc-linux-gnu
cc_compiler=gcc
cxx_compiler=g++

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11
build_type=Release
compiler.libcxx=libstdc++11
[options]
[build_requires]
[env]
CHOST=$target_host
AR=$target_host-ar
RANLIB=$target_host-ranlib
CC=$target_host-$cc_compiler
CXX=$target_host-$cxx_compiler

conanfile.txt

[requires]
portaudio/19.7.0@bincrafters/stable
opus/1.3.1
qt/5.15.2
asio/1.19.2
sqlite_orm/1.6
sqlite3/3.36.0
libuuid/1.0.3

[options]
*:shared=True

[imports]
lib, *.so* -> lib

[generators]
qt
cmake

CMakeLists.txt

if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
    message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the source code and call cmake from there")
endif ()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})

project(babel)
cmake_minimum_required(VERSION 3.17.4)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_definitions("-fPIC")

if(MSVC)
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
else()
    set(STANDARD_UNIX_CXX_FLAGS "-Wall -g3 -Wextra -Wfatal-errors")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STANDARD_UNIX_CXX_FLAGS}")
endif()

if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
    include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
else()
    message(FATAL_ERROR "No conanbuildinfo.cmake file found")
endif()

conan_basic_setup(TARGETS)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt5OpenGL CONFIG REQUIRED)
find_package(Qt5Widgets CONFIG REQUIRED)
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Gui CONFIG REQUIRED)
find_package(Qt5Network CONFIG REQUIRED)

include_directories("${PROJECT_SOURCE_DIR}/include/client")
include_directories("${PROJECT_SOURCE_DIR}/include/server")
include_directories("${PROJECT_SOURCE_DIR}/include/common")

file(
        GLOB_RECURSE
        SOURCES_CLIENT
        ${PROJECT_SOURCE_DIR}/src/*.cpp
        ${PROJECT_SOURCE_DIR}/src/client/*.cpp
)
file(
        GLOB_RECURSE
        SOURCES_SERVER
        ${PROJECT_SOURCE_DIR}/src/server/*.cpp
)
file(
        GLOB_RECURSE
        SOURCES_COMMON
        ${PROJECT_SOURCE_DIR}/src/common/*.cpp
        ${PROJECT_SOURCE_DIR}/include/common/*.hpp
)
add_executable(babel_client ${SOURCES_CLIENT} ${SOURCES_COMMON})
install(TARGETS babel_client DESTINATION ${PROJECT_SOURCE_DIR}/bin)
target_link_libraries(
        babel_client
        ${CONAN_LIBS}
        Qt5::Widgets
        Qt5::Network
        Qt5::OpenGL
        Qt5::Core
        Qt5::Gui
)
target_include_directories(
        babel_client PRIVATE
        ${CONAN_INCLUDE_LIBS}
        ${PROJECT_SOURCE_DIR}/include/client
        ${PROJECT_SOURCE_DIR}/include/common
)

Commands used:

rm -rf build && mkdir build && cd build
conan install .. --profile=64-linux-gnu11
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

Output:

-------------------------------------------------------------------
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
AR=x86_64-pc-linux-gnu-ar
CC=x86_64-pc-linux-gnu-gcc
CHOST=x86_64-pc-linux-gnu
CXX=x86_64-pc-linux-gnu-g++
RANLIB=x86_64-pc-linux-gnu-ranlib
WARN: sqlite_orm/1.6: requirement sqlite3/3.34.1 overridden by your conanfile to sqlite3/3.36.0 
conanfile.txt: Installing package
Requirements
    asio/1.19.2 from local cache - Cache
    brotli/1.0.9 from local cache - Cache
    bzip2/1.0.8 from local cache - Cache
    double-conversion/3.1.5 from local cache - Cache
    expat/2.4.1 from local cache - Cache
    fontconfig/2.13.93 from local cache - Cache
    freetype/2.10.4 from local cache - Cache
    icu/69.1 from local cache - Cache
    libalsa/1.1.9 from local cache - Cache
    libffi/3.4.2 from local cache - Cache
    libiconv/1.16 from local cache - Cache
    libjpeg/9d from local cache - Cache
    libmysqlclient/8.0.25 from local cache - Cache
    libpng/1.6.37 from local cache - Cache
    libpq/13.2 from local cache - Cache
    libuuid/1.0.3 from local cache - Cache
    libxml2/2.9.12 from local cache - Cache
    lz4/1.9.3 from local cache - Cache
    odbc/2.3.9 from local cache - Cache
    opengl/system from local cache - Cache
    openssl/1.1.1k from local cache - Cache
    opus/1.3.1 from local cache - Cache
    pcre2/10.37 from local cache - Cache
    portaudio/19.7.0@bincrafters/stable from 'bincrafters' - Cache
    qt/5.15.2 from local cache - Cache
    sqlite3/3.36.0 from local cache - Cache
    sqlite_orm/1.6 from local cache - Cache
    wayland/1.19.0 from local cache - Cache
    wayland-protocols/1.21 from local cache - Cache
    xkbcommon/1.3.0 from local cache - Cache
    xorg/system from local cache - Cache
    zlib/1.2.11 from local cache - Cache
    zstd/1.5.0 from local cache - Cache
Packages
    asio/1.19.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    brotli/1.0.9:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    bzip2/1.0.8:d47b7dd97f503792f0e2103d59c090225d859006 - Cache
    double-conversion/3.1.5:f5479da590b48f565e631f6257bd759b7a02c057 - Cache
    expat/2.4.1:ea6ef36313556e867a1a234b9ea0769c1f459596 - Cache
    fontconfig/2.13.93:00bf85392d1f9348fa272c1a701219a183422bc5 - Cache
    freetype/2.10.4:c420499ac33a1221bb3144653c2b27fd1a0c9d97 - Cache
    icu/69.1:fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18 - Cache
    libalsa/1.1.9:45572951e04977fe87dc4117ce69daf41aa9589c - Cache
    libffi/3.4.2:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    libiconv/1.16:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    libjpeg/9d:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    libmysqlclient/8.0.25:b471b55c005c602d1d3c04b9a8867bb5e1f9207d - Cache
    libpng/1.6.37:307017786caa3aee00a1a1adaa77e454618ad6c7 - Cache
    libpq/13.2:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    libuuid/1.0.3:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    libxml2/2.9.12:45ea34b0d863d2692204009fcd0cf5db903fb127 - Cache
    lz4/1.9.3:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    odbc/2.3.9:620c869d7adeee159670f834f2253251b5853c82 - Cache
    opengl/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    openssl/1.1.1k:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    opus/1.3.1:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    pcre2/10.37:57ad029ecdb3834ab823bfef11c5d30bada8a994 - Cache
    portaudio/19.7.0@bincrafters/stable:17023381209956eab18fdb2ee91ccc7d65ccf58c - Cache
    qt/5.15.2:1f1a348feb20ff201ed6678a6bc4117c690e4b47 - Cache
    sqlite3/3.36.0:a0b65e650ff469ca7d77f2c17f629d7350aa7993 - Cache
    sqlite_orm/1.6:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    wayland/1.19.0:d15bee583d6a1a6bc5b9608af132d5d3ec352761 - Cache
    wayland-protocols/1.21:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    xkbcommon/1.3.0:be11e2e2f89433a0aab31fe7894ce50c9d922bc6 - Cache
    xorg/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    zlib/1.2.11:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache
    zstd/1.5.0:1748639999ed79b998e4fe4a6d292ed8e874736a - Cache

Installing (downloading, building) binaries...
asio/1.19.2: Already installed!
brotli/1.0.9: Already installed!
bzip2/1.0.8: Already installed!
bzip2/1.0.8: Appending PATH environment variable: /home/bltksk/.conan/data/bzip2/1.0.8/_/_/package/d47b7dd97f503792f0e2103d59c090225d859006/bin
double-conversion/3.1.5: Already installed!
expat/2.4.1: Already installed!
icu/69.1: Already installed!
icu/69.1: Appending ICU_DATA environment variable: /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/res/icudt69l.dat
icu/69.1: Appending PATH environment variable: /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/bin
libalsa/1.1.9: Already installed!
libffi/3.4.2: Already installed!
libiconv/1.16: Already installed!
libiconv/1.16: Appending PATH environment var: /home/bltksk/.conan/data/libiconv/1.16/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/bin
libjpeg/9d: Already installed!
libpq/13.2: Already installed!
libuuid/1.0.3: Already installed!
lz4/1.9.3: Already installed!
opengl/system: Already installed!
openssl/1.1.1k: Already installed!
opus/1.3.1: Already installed!
sqlite3/3.36.0: Already installed!
sqlite3/3.36.0: Appending PATH env var with : /home/bltksk/.conan/data/sqlite3/3.36.0/_/_/package/a0b65e650ff469ca7d77f2c17f629d7350aa7993/bin
wayland-protocols/1.21: Already installed!
xorg/system: Already installed!
zlib/1.2.11: Already installed!
zstd/1.5.0: Already installed!
libmysqlclient/8.0.25: Already installed!
libpng/1.6.37: Already installed!
libxml2/2.9.12: Already installed!
libxml2/2.9.12: Appending PATH environment variable: /home/bltksk/.conan/data/libxml2/2.9.12/_/_/package/45ea34b0d863d2692204009fcd0cf5db903fb127/bin
odbc/2.3.9: Already installed!
odbc/2.3.9: Appending PATH environment variable: /home/bltksk/.conan/data/odbc/2.3.9/_/_/package/620c869d7adeee159670f834f2253251b5853c82/bin
pcre2/10.37: Already installed!
pcre2/10.37: Appending PATH environment variable: /home/bltksk/.conan/data/pcre2/10.37/_/_/package/57ad029ecdb3834ab823bfef11c5d30bada8a994/bin
portaudio/19.7.0@bincrafters/stable: Already installed!
sqlite_orm/1.6: Already installed!
freetype/2.10.4: Already installed!
wayland/1.19.0: Already installed!
wayland/1.19.0: Appending PATH environment variable: /home/bltksk/.conan/data/wayland/1.19.0/_/_/package/d15bee583d6a1a6bc5b9608af132d5d3ec352761/bin
fontconfig/2.13.93: Already installed!
fontconfig/2.13.93: Creating FONTCONFIG_FILE environment variable: /home/bltksk/.conan/data/fontconfig/2.13.93/_/_/package/00bf85392d1f9348fa272c1a701219a183422bc5/bin/etc/fonts/fonts.conf
fontconfig/2.13.93: Creating FONTCONFIG_PATH environment variable: /home/bltksk/.conan/data/fontconfig/2.13.93/_/_/package/00bf85392d1f9348fa272c1a701219a183422bc5/bin/etc/fonts
xkbcommon/1.3.0: Already installed!
xkbcommon/1.3.0: Appending PATH environment variable: /home/bltksk/.conan/data/xkbcommon/1.3.0/_/_/package/be11e2e2f89433a0aab31fe7894ce50c9d922bc6/bin
qt/5.15.2: Already installed!
conanfile.txt: Generator txt created conanbuildinfo.txt
conanfile.txt: Generator qt created qt.conf
conanfile.txt: Generator cmake created conanbuildinfo.cmake
conanfile.txt: Aggregating env generators
conanfile.txt: Generated conaninfo.txt
conanfile.txt: Generated graphinfo
conanfile.txt imports(): Copied 29 '.0' files
conanfile.txt imports(): Copied 67 '.so' files
conanfile.txt imports(): Copied 13 '.15' files
conanfile.txt imports(): Copied 15 '.5' files
conanfile.txt imports(): Copied 25 '.1' files
conanfile.txt imports(): Copied 1 '.12' file: libxml2.so.2.9.12
conanfile.txt imports(): Copied 1 '.13' file: libpq.so.5.13
conanfile.txt imports(): Copied 4 '.9' files: libbrotlicommon.so.1.0.9, libbrotlidec.so.1.0.9, libbrotlienc.so.1.0.9, libjpeg.so.9
conanfile.txt imports(): Copied 1 '.4' file: libfreetype.so.6.17.4
conanfile.txt imports(): Copied 3 '.3' files: libpcre2-posix.so.3, libdouble-conversion.so.3, liblz4.so.1.9.3
conanfile.txt imports(): Copied 22 '.2' files
conanfile.txt imports(): Copied 1 '.11' file: libz.so.1.2.11
conanfile.txt imports(): Copied 1 '.16' file: libpng16.so.16
conanfile.txt imports(): Copied 6 '.69' files
conanfile.txt imports(): Copied 1 '.6' file: libfreetype.so.6
conanfile.txt imports(): Copied 1 '.25' file: libmysqlclient.so.21.1.25
conanfile.txt imports(): Copied 1 '.8' file: libbz2.so.1.0.8
conanfile.txt imports(): Copied 1 '.7' file: libltdl.so.7
conanfile.txt imports(): Copied 1 '.21' file: libmysqlclient.so.21
-------------------------------------------------------------------
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Library portaudio found /home/bltksk/.conan/data/portaudio/19.7.0/bincrafters/stable/package/17023381209956eab18fdb2ee91ccc7d65ccf58c/lib/libportaudio.so
-- Library opus found /home/bltksk/.conan/data/opus/1.3.1/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libopus.so
-- Library Qt5XcbQpa found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5XcbQpa.so
-- Library Qt5Network found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Network.so
-- Library Qt5Sql found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Sql.so
-- Library Qt5Test found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Test.so
-- Library Qt5PrintSupport found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5PrintSupport.so
-- Library Qt5Widgets found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Widgets.so
-- Library Qt5OpenGL found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5OpenGL.so
-- Library Qt5OpenGLExtensions found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5OpenGLExtensions.a
-- Library Qt5Gui found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Gui.so
-- Library Qt5Concurrent found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Concurrent.so
-- Library Qt5Xml found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Xml.so
-- Library Qt5Core found /home/bltksk/.conan/data/qt/5.15.2/_/_/package/1f1a348feb20ff201ed6678a6bc4117c690e4b47/lib/libQt5Core.so
-- Library asound found /home/bltksk/.conan/data/libalsa/1.1.9/_/_/package/45572951e04977fe87dc4117ce69daf41aa9589c/lib/libasound.so
-- Library pcre2-posix found /home/bltksk/.conan/data/pcre2/10.37/_/_/package/57ad029ecdb3834ab823bfef11c5d30bada8a994/lib/libpcre2-posix.so
-- Library pcre2-8 found /home/bltksk/.conan/data/pcre2/10.37/_/_/package/57ad029ecdb3834ab823bfef11c5d30bada8a994/lib/libpcre2-8.so
-- Library pcre2-16 found /home/bltksk/.conan/data/pcre2/10.37/_/_/package/57ad029ecdb3834ab823bfef11c5d30bada8a994/lib/libpcre2-16.so
-- Library pcre2-32 found /home/bltksk/.conan/data/pcre2/10.37/_/_/package/57ad029ecdb3834ab823bfef11c5d30bada8a994/lib/libpcre2-32.so
-- Library double-conversion found /home/bltksk/.conan/data/double-conversion/3.1.5/_/_/package/f5479da590b48f565e631f6257bd759b7a02c057/lib/libdouble-conversion.so
-- Library fontconfig found /home/bltksk/.conan/data/fontconfig/2.13.93/_/_/package/00bf85392d1f9348fa272c1a701219a183422bc5/lib/libfontconfig.so
-- Library icuio found /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/lib/libicuio.so
-- Library icutest found /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/lib/libicutest.so
-- Library icutu found /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/lib/libicutu.so
-- Library icui18n found /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/lib/libicui18n.so
-- Library icuuc found /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/lib/libicuuc.so
-- Library icudata found /home/bltksk/.conan/data/icu/69.1/_/_/package/fe076d54922d9a7cecbe53dc3b3bd0fc5b502a18/lib/libicudata.so
-- Library jpeg found /home/bltksk/.conan/data/libjpeg/9d/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libjpeg.so
-- Library sqlite3 found /home/bltksk/.conan/data/sqlite3/3.36.0/_/_/package/a0b65e650ff469ca7d77f2c17f629d7350aa7993/lib/libsqlite3.so
-- Library mysqlclient found /home/bltksk/.conan/data/libmysqlclient/8.0.25/_/_/package/b471b55c005c602d1d3c04b9a8867bb5e1f9207d/lib/libmysqlclient.so
-- Library pq found /home/bltksk/.conan/data/libpq/13.2/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libpq.so
-- Library odbc found /home/bltksk/.conan/data/odbc/2.3.9/_/_/package/620c869d7adeee159670f834f2253251b5853c82/lib/libodbc.so
-- Library odbcinst found /home/bltksk/.conan/data/odbc/2.3.9/_/_/package/620c869d7adeee159670f834f2253251b5853c82/lib/libodbcinst.so
-- Library odbccr found /home/bltksk/.conan/data/odbc/2.3.9/_/_/package/620c869d7adeee159670f834f2253251b5853c82/lib/libodbccr.so
-- Library ltdl found /home/bltksk/.conan/data/odbc/2.3.9/_/_/package/620c869d7adeee159670f834f2253251b5853c82/lib/libltdl.so
-- Library xkbcommon-x11 found /home/bltksk/.conan/data/xkbcommon/1.3.0/_/_/package/be11e2e2f89433a0aab31fe7894ce50c9d922bc6/lib/libxkbcommon-x11.so
-- Library xkbcommon found /home/bltksk/.conan/data/xkbcommon/1.3.0/_/_/package/be11e2e2f89433a0aab31fe7894ce50c9d922bc6/lib/libxkbcommon.so
-- Library xkbregistry found /home/bltksk/.conan/data/xkbcommon/1.3.0/_/_/package/be11e2e2f89433a0aab31fe7894ce50c9d922bc6/lib/libxkbregistry.so
-- Library ssl found /home/bltksk/.conan/data/openssl/1.1.1k/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libssl.so
-- Library crypto found /home/bltksk/.conan/data/openssl/1.1.1k/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libcrypto.so
-- Library freetype found /home/bltksk/.conan/data/freetype/2.10.4/_/_/package/c420499ac33a1221bb3144653c2b27fd1a0c9d97/lib/libfreetype.so
-- Library uuid found /home/bltksk/.conan/data/libuuid/1.0.3/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libuuid.so
-- Library zstd found /home/bltksk/.conan/data/zstd/1.5.0/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libzstd.so
-- Library lz4 found /home/bltksk/.conan/data/lz4/1.9.3/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/liblz4.so
-- Library wayland-server found /home/bltksk/.conan/data/wayland/1.19.0/_/_/package/d15bee583d6a1a6bc5b9608af132d5d3ec352761/lib/libwayland-server.so
-- Library wayland-cursor found /home/bltksk/.conan/data/wayland/1.19.0/_/_/package/d15bee583d6a1a6bc5b9608af132d5d3ec352761/lib/libwayland-cursor.so
-- Library wayland-egl found /home/bltksk/.conan/data/wayland/1.19.0/_/_/package/d15bee583d6a1a6bc5b9608af132d5d3ec352761/lib/libwayland-egl.so
-- Library wayland-client found /home/bltksk/.conan/data/wayland/1.19.0/_/_/package/d15bee583d6a1a6bc5b9608af132d5d3ec352761/lib/libwayland-client.so
-- Library bz2 found /home/bltksk/.conan/data/bzip2/1.0.8/_/_/package/d47b7dd97f503792f0e2103d59c090225d859006/lib/libbz2.so
-- Library png16 found /home/bltksk/.conan/data/libpng/1.6.37/_/_/package/307017786caa3aee00a1a1adaa77e454618ad6c7/lib/libpng16.so
-- Library brotlidec found /home/bltksk/.conan/data/brotli/1.0.9/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libbrotlidec.so
-- Library brotlienc found /home/bltksk/.conan/data/brotli/1.0.9/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libbrotlienc.so
-- Library brotlicommon found /home/bltksk/.conan/data/brotli/1.0.9/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libbrotlicommon.so
-- Library expat found /home/bltksk/.conan/data/expat/2.4.1/_/_/package/ea6ef36313556e867a1a234b9ea0769c1f459596/lib/libexpat.so
-- Library xml2 found /home/bltksk/.conan/data/libxml2/2.9.12/_/_/package/45ea34b0d863d2692204009fcd0cf5db903fb127/lib/libxml2.so
-- Library ffi found /home/bltksk/.conan/data/libffi/3.4.2/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libffi.so
-- Library z found /home/bltksk/.conan/data/zlib/1.2.11/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libz.so
-- Library iconv found /home/bltksk/.conan/data/libiconv/1.16/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libiconv.so
-- Library charset found /home/bltksk/.conan/data/libiconv/1.16/_/_/package/1748639999ed79b998e4fe4a6d292ed8e874736a/lib/libcharset.so
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: /home/bltksk/epitech/tek3/CPP/babel/build
-- Conan: Compiler GCC>=5, checking major version 11
-- Conan: Checking correct version: 11
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bltksk/epitech/tek3/CPP/babel/build
-------------------------------------------------------------------
[ 20%] Automatic MOC and UIC for target babel_client
[ 20%] Built target babel_client_autogen
[ 40%] Building CXX object CMakeFiles/babel_client.dir/babel_client_autogen/mocs_compilation.cpp.o
[ 60%] Building CXX object CMakeFiles/babel_client.dir/src/client/Profile.cpp.o
[ 80%] Building CXX object CMakeFiles/babel_client.dir/src/main.cpp.o
[100%] Linking CXX executable bin/babel_client
/usr/bin/ld: cannot find -lmysqlclient
/usr/bin/ld: cannot find -lpq
/usr/bin/ld: cannot find -lodbc
/usr/bin/ld: cannot find -lodbcinst
/usr/bin/ld: cannot find -lodbccr
/usr/bin/ld: cannot find -liconv
/usr/bin/ld: cannot find -lcharset
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/babel_client.dir/build.make:134: bin/babel_client] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/babel_client.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I don't understand what's happening. The libraries are downloaded. Am I using conan from cmake in a wrong way? Maybe I'm missing some things in CMakeLists.txt, I'm kind of new to cmake.

Alvaro
  • 27
  • 1
  • 6
  • 2
    You are using [TARGETS](https://docs.conan.io/en/latest/integrations/build_system/cmake/cmake_generator.html#targets-approach) but consuming `${CONAN_LIBS}`. It won't work. Don't use TARGETS if you are consuming CONAN_LIBS. – uilianries Oct 01 '21 at 14:48
  • As @uilianries wrote, don't use TARGETS if you want to consume the libraries with `${CONAN_LIBS}`. In case you do want to use TARGETS, instead of `${CONAN_LIBS}` you need to add something like `CONAN_PKG::portaudio` (and for all of the other libraries installed through conan) to target_link_libraries. – darcamo Oct 02 '21 at 15:14
  • I would not recommend CONAN_PKG:: because it will be deprecated for Conan 2.0, you still can use `cmake_find_package` generator, or even new Conan Toolchain generators which should be the default for Conan 2.0 – uilianries Oct 02 '21 at 20:29

0 Answers0