Closed TaxMachine closed 1 year ago
target_link_libraries(projetct PUBLIC ${LINKS})
Is this a typo only here?
not its not even my project name it doesnt matter
You can use the library without CMake. Just include the headers and link it, like any other Unix library. It would go something like:
g++ -std=c++17 -I ./include/ -I /opt/boost-1.75.0/include/ -L ./build/ -L /opt/boost-1.75.0/lib/ -L /usr/lib/x86_64-linux-gnu/ test.cpp -o test -lboost_system -lboost_regex -lboost_date_time -lpthread -lcrypto -lssl -lmailio
where the test.cpp
is your own example. Ensure that the shared library (libmailio.so) is available.
my project is using CMake I cannot not use it
also I am not on linux
Here is an extract from one project which uses Mailio:
cmake_minimum_required (VERSION 3.14)
set(PROJ kama)
project (${PROJ} VERSION 0.2.0)
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(PROJSRC
${PROJECT_SOURCE_DIR}/source/main.cpp
${PROJECT_SOURCE_DIR}/source/configuration.cpp
${PROJECT_SOURCE_DIR}/source/db_model.cpp
${PROJECT_SOURCE_DIR}/source/sender.cpp
${PROJECT_SOURCE_DIR}/source/receiver.cpp
)
set(PROJINC
${PROJECT_SOURCE_DIR}/include/configuration.hpp
${PROJECT_SOURCE_DIR}/include/db_model.hpp
${PROJECT_SOURCE_DIR}/include/sender.hpp
${PROJECT_SOURCE_DIR}/include/receiver.hpp
)
add_definitions(-DBOOST_ALL_DYN_LINK)
find_package(Boost COMPONENTS system thread REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
find_package(Threads REQUIRED)
include_directories(include)
find_package(OpenSSL)
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/libs/mailio/include)
find_library(MAILIO_LIB mailio HINTS ${CMAKE_SOURCE_DIR}/libs/mailio/build)
add_executable(${PROJ} ${PROJSRC} ${PROJINC})
target_link_libraries(${PROJ} ${Boost_LIBRARIES} Threads::Threads ${OPENSSL_LIBRARIES} ${MAILIO_LIB})
Let me know whether it works, since I have stripped the other libraries used by the project.
still doesnt link
Are you using Windows and MSVC? Did Vcpkg compiled the library into mailio.lib
and mailio.dll
libraries?
Im using g++ and vcpkg compiled them yes, i tried to include those libs in the cmakelist but it still didn't work
If the examples and test compile, then the library should be installed. Since your CMake cannot locate the library, you can turn on the verbose mode and check the execution output.
Cannot be considered as the mailio problem.
its most probably a user issue but im clueless of what I'm suppose to do because of the lack of good documentation. I am trying to use your library from vcpkg and I get this error when I compile the code
I have this in my CMakeLists.txt
what is the thing im not doing correctly, I tried to do the same as the examples but with no success