mailio
mailio copied to clipboard
Tests fail to link: ld: error: undefined symbol: main
===> Testing for mailio-0.23.0.59
-- Found Boost: /usr/local/include (found version "1.84.0") found components: system date_time regex url
-- Found Boost: /usr/local/include (found version "1.84.0") found components: unit_test_framework
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /usr/ports/mail/mailio/work/.build
[100% 1/1] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DNDEBUG -fstack-protector-strong test/CMakeFiles/test_message.dir/test_message.cpp.o -o test/test_message -L/usr/local/lib -Wl,-rpath,/usr/local/lib:/usr/ports/mail/mailio/work/.build: /usr/local/lib/libboost_unit_test_framework.so libmailio.so -lpthread /usr/local/lib/libboost_system.so /usr/local/lib/libboost_date_time.so /usr/local/lib/libboost_regex.so /usr/local/lib/libboost_url.so /usr/lib/libssl.so /usr/lib/libcrypto.so && :
FAILED: test/test_message
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DNDEBUG -fstack-protector-strong test/CMakeFiles/test_message.dir/test_message.cpp.o -o test/test_message -L/usr/local/lib -Wl,-rpath,/usr/local/lib:/usr/ports/mail/mailio/work/.build: /usr/local/lib/libboost_unit_test_framework.so libmailio.so -lpthread /usr/local/lib/libboost_system.so /usr/local/lib/libboost_date_time.so /usr/local/lib/libboost_regex.so /usr/local/lib/libboost_url.so /usr/lib/libssl.so /usr/lib/libcrypto.so && :
ld: error: undefined symbol: main
>>> referenced by crt1_s.S:69 (/disk-samsung/freebsd-src/lib/csu/amd64/crt1_s.S:69)
>>> /usr/lib/crt1.o:(_start)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
*** Error code 1
Can you please try with the option MAILIO_DYN_LINK_TESTS turned on and let me know about the result?
-DMAILIO_DYN_LINK_TESTS=ON makes tests to build successfully.
I will check whether I can put the dynamic linkage by default. I had problems with tests in general when deploying on Vcpkg.