karastojko / mailio

mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.
Other
372 stars 98 forks source link

Problems compiling the example code with CMake #130

Closed VogelPapaFinn closed 11 months ago

VogelPapaFinn commented 1 year ago

I installed Boost, OpenSSL and mailio with vcpkg. When I run the example code (from the README.md) I get undefined references for mailio and boost::asio code.

My current CMakeLists.txt:

cmake_minimum_required(VERSION 3.25)
project(FaroMail)

set(CMAKE_CXX_STANDARD 17)

find_package(Boost REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(mailio REQUIRED)

add_executable(FaroMail main.cpp)

target_link_libraries(FaroMail mailio)

Adding Boost and OpenSSL as target_link_libraries results in an ld.exe error:

...bin/ld.exe: cannot find -lOpenSSL
...bin/ld.exe: cannot find -lBoost

I tried many things (too many to mention) from compiling myself to using different include methods. Any ideas what could be the problem?

karastojko commented 1 year ago

Have the mailio examples compiled when installing with Vcpkg? Do you have binaries in the build/examples directory? Or, is it a your own example you are trying to build?