Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail to link: ld: error: undefined symbol: main #159

Open
yurivict opened this issue Mar 27, 2024 · 3 comments
Open

Tests fail to link: ld: error: undefined symbol: main #159

yurivict opened this issue Mar 27, 2024 · 3 comments

Comments

@yurivict
Copy link

===>  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
@karastojko
Copy link
Owner

Can you please try with the option MAILIO_DYN_LINK_TESTS turned on and let me know about the result?

@yurivict
Copy link
Author

-DMAILIO_DYN_LINK_TESTS=ON makes tests to build successfully.

@karastojko
Copy link
Owner

I will check whether I can put the dynamic linkage by default. I had problems with tests in general when deploying on Vcpkg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants