0

We use bjam to build the boost libs with the following parameters

  bjam --prefix=.\vs2012\x86\static --includedir=.\include --build-dir=.\build\vs2012\x86 --layout=system --build-type=minimal --without-mpi --without-python toolset=msvc-11.0 variant=release threading=multi link=static runtime-link=shared define=_BIND_TO_CURRENT_VCLIBS_VERSION address-model=32 install

So the lib names looks like libboost_unit_test_framework.lib. But when build the project I get fatal error LNK1104: cannot open file 'libboost_unit_test_framework-vc110-mt-1_53.lib' Well, I tried almost every solution for the linking issue LNK1104 e.g. suggested here, but nothing helps. Do you have any ideas what is going wrong? Here my test code

#define BOOST_TEST_MODULE MyClass test
#include <boost/test/unit_test.hpp>
#include "myclass.h"

BOOST_AUTO_TEST_CASE(Calc_Test)
{
  MyClass* c = new MyClass();
  BOOST_CHECK(c);
}
Community
  • 1
  • 1
alex555
  • 1,676
  • 4
  • 27
  • 45

2 Answers2

0

You have boost auto-linking enabled.

Use the following define to disable this option: BOOST_ALL_NO_LIB.

See here more information on the topic.

Alexandru C.
  • 3,337
  • 1
  • 25
  • 27
0

You are using --layout=system which builds without the tags on the build results. And when you use the headers you don't disable the auto-link feature (by defining BOOST_ALL_NO_LIB). Either:

  1. Remove the --layout=system option, or
  2. Disable auto-link by defining BOOST_ALL_NO_LIB and manually add the *.lib files to your link.
GrafikRobot
  • 3,020
  • 1
  • 20
  • 21