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

boost v1.66 boost test linker LNK2005 errors #2444

Closed
shanepowell opened this issue Dec 25, 2017 · 2 comments
Closed

boost v1.66 boost test linker LNK2005 errors #2444

shanepowell opened this issue Dec 25, 2017 · 2 comments
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@shanepowell
Copy link

Compiler : VC2017 v15.5.2
Branch : master
Boost : 1.66
Triplet : x86-windows, x64-windows

Error :

1>boost_unit_test_framework-vc140-mt-gd-1_66.lib(boost_unit_test_framework-vc141-mt-gd-x32-1_66.dll) : error LNK2005: "public: static class boost::unit_test::unit_test_log_t & __cdecl boost::unit_test::singleton::instance(void)" (?instance@?$singleton@Vunit_test_log_t@unit_test@boost@@@unit_test@boost@@SAAAVunit_test_log_t@23@XZ) already defined in boost_test_exec_monitor-vc140-mt-gd-1_66.lib(test_tools.obj)
....

Might be related to : #2057

Repro:
Create VC2017 C++ console application and paste following:

#define BOOST_TEST_MODULE MyTest
#include <boost/test/unit_test.hpp>

int add(int i, int j) { return i + j; }

BOOST_AUTO_TEST_CASE(my_test)
{
BOOST_CHECK(add(2, 2) == 4); // #1 continues on error
}

Compile and link release or debug, win32 or x64

Workaround: remove 'boost_test_exec_monitor-vc140-mt-gd-1_66.lib' from the installed lib directories

@ras0219-msft ras0219-msft added the category:port-bug The issue is with a library, which is something the port should already support label Jan 3, 2018
@ras0219-msft
Copy link
Contributor

This is a regression back to the bad behavior described in #2057.

@ras0219-msft
Copy link
Contributor

Thank you for reporting this; the fix is pushed to master!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

2 participants