karastojko/mailio

Problems compiling the example code with CMake

Closed this issue · 1 comments

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?

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?