Git Product home page Git Product logo

Comments (11)

karastojko avatar karastojko commented on June 2, 2024

target_link_libraries(projetct PUBLIC ${LINKS})
Is this a typo only here?

from mailio.

TaxMachine avatar TaxMachine commented on June 2, 2024

not its not even my project name it doesnt matter

from mailio.

karastojko avatar karastojko commented on June 2, 2024

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.

from mailio.

TaxMachine avatar TaxMachine commented on June 2, 2024

my project is using CMake I cannot not use it

from mailio.

TaxMachine avatar TaxMachine commented on June 2, 2024

also I am not on linux

from mailio.

karastojko avatar karastojko commented on June 2, 2024

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.

from mailio.

TaxMachine avatar TaxMachine commented on June 2, 2024

still doesnt link

from mailio.

karastojko avatar karastojko commented on June 2, 2024

Are you using Windows and MSVC? Did Vcpkg compiled the library into mailio.lib and mailio.dll libraries?

from mailio.

TaxMachine avatar TaxMachine commented on June 2, 2024

Im using g++ and vcpkg compiled them yes, i tried to include those libs in the cmakelist but it still didn't work

from mailio.

karastojko avatar karastojko commented on June 2, 2024

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.

from mailio.

karastojko avatar karastojko commented on June 2, 2024

Cannot be considered as the mailio problem.

from mailio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.