Closed mavavilj closed 8 years ago
Yes it works (it is the standard FindBoost from CMake). I tried it with different versions, works like a charm. Use the gui if there is an issue with setting up the variables: that's how I prefer to set Boost up if the path is not "standard".
Unable to find the requested Boost libraries.
Boost version: 1.58.0
Boost include path: C:/Developer/Libs_cpp/boost_1_58_0/boost
Could not find the following Boost libraries:
boost_unit_test_framework
boost_system
If you don't have a compiled version of Boost installed in BOOST_ROOT, it can't work. The libraries themselves are only required for the unit tests (be aware that the IO module is currently failing).
BOOST_ROOT points to a folder which is the same as this: http://sourceforge.net/projects/boost/files/boost-binaries/1.58.0/
If you don't have the Boost libraries compiled for your compiler, it will not work. You can also select the libraries by hand in the GUI if CMake doesn't pick them up automatically.
Got it working by compiling boost (like described here: http://choorucode.com/2014/06/06/how-to-build-boost-for-visual-studio-2013/), but the produced VS2013 project doesn't compile.
There are 86 errors about missing files regarding boost.
Good, we are moving forward! Strange that the package you got didn't contain everything. The issue may be that you have the shared libraries, but for an obscure reason that I also observed before, CMake indicates to VS that it's the static version it needs. If the error starts with something like "can't find boost-unit-framework*", then you need to recompile with static libraries (it's an option on b2). Otherwise, you need to give me the first errors to see what is going on.
So I switched to precompiled headers. Here: http://sourceforge.net/projects/boost/files/boost-binaries/1.58.0/ and using the boost_1_58_0-msvc-12.0-32 one the project seems to compile (it runs for while), but it finally returns:
error LNK1181: cannot open input file 'ATKDelay.lib' error LNK1181: cannot open input file 'ATKMock.lib' error LNK1181: cannot open input file 'ATKDynamic.lib' error LNK1181: cannot open input file 'ATKIO.lib' error LNK1181: cannot open input file 'ATKMock.lib' error LNK1181: cannot open input file 'ATSpecial.lib'
Both for static and shared compilation.
OK, that's a biggger issue. First, the tests only work for shared libraries, but then it should find the new ATK libraries. Are you sure these are the first errors? If you try to compile only ATKMock, what happens?
compiling ATKMock_static builds, but ATKMock_test produces the error: error LNK1181: cannot open input file 'ATKMock.lib'
Same is true for the other _test suffixed projects.
The above mentioned LNK1181s are the only errors produced.
As I've said, only the shared libraries can be linked with the unit tests. There should have been an error if you try to build tests without shared libraries, so something must be wrong when building the shared libraries. What's the error when trying to build ATKMock?
So I mangled a bit with the CMake settings: ENABLE_SHARED_LIBRARIES, ENABLE_STATIC_LIBRARIES, ENABLE_TESTS.
Crossing only ENABLE_STATIC_LIBRARIES and the whole project builds (Except for INSTALL and RUN_TESTS which are skipped), the other combinations fail (in varied ways).
Is this a usable build though? I can't seem to be able to build shared libraries at all. Also this one does not produce a single .lib file anywhere.
Yes, the static build is the one I use for plugins actually (on Windows, you may need to change the run time libraries from /MD to /MT IIRC). Still strange for the shared library build + tests, this is the one I use to develop and then use the static build for plugins. So you should get shared libraries available, except if there is an error during their build that you haven't shown me. The .lib are scattered in the respective build folders. To have them all in one place, you need to install them. Standard CMake procedure.
ENABLE_SHARED_LIBRARIES and ENABLE_TESTS enabled:
Errors:
Error 268 error LNK2019: unresolved external symbol "declspec(dllimport) public: thiscall boost::test_tools::predicate_result::predicate_result(bool)" (imp_??0predicate_result@test_tools@boost@@QAE@_N@Z) referenced in function "bool cdecl boost::test_tools::tt_detail::check_frwd<struct boost::test_tools::check_is_small_t,double,double>(struct boost::test_tools::check_is_small_t,class boost::unit_test::lazy_ostream const &,class boost::unit_test::basic_cstringanonymous namespace'::
dynamic initializer for 'unit_test_log''(void)" (??Eunit_test_log@?A0x2ab92bb9@unit_test@boost@@YAXXZ) C:\Developer\Libs_cpp\AudioTK-develop\build\ATK\Mock\FFTCheckerFilter.obj ATKMock
Error 279 error LNK2001: unresolved external symbol "declspec(dllimport) public: static class boost::unit_test::unit_test_log_t & cdecl boost::unit_test::singleton
ENABLE_SHARED_LIBRARIES enabled:
Errors:
Error 268 error LNK2019: unresolved external symbol "declspec(dllimport) public: thiscall boost::test_tools::predicate_result::predicate_result(bool)" (imp_??0predicate_result@test_tools@boost@@QAE@_N@Z) referenced in function "bool cdecl boost::test_tools::tt_detail::check_frwd<struct boost::test_tools::check_is_small_t,double,double>(struct boost::test_tools::check_is_small_t,class boost::unit_test::lazy_ostream const &,class boost::unit_test::basic_cstringanonymous namespace'::
dynamic initializer for 'unit_test_log''(void)" (??Eunit_test_log@?A0x2ab92bb9@unit_test@boost@@YAXXZ) C:\Developer\Libs_cpp\AudioTK-develop\build\ATK\Mock\FFTCheckerFilter.obj ATKMock
Error 279 error LNK2001: unresolved external symbol "declspec(dllimport) public: static class boost::unit_test::unit_test_log_t & cdecl boost::unit_test::singleton
Also I've never needed to done the CMake "install phase" since the CMakeLists.txt that I've seen in other libraries have had instructions for the installation as well, at least I guess. I don't know how to do the install.
Oh... I think I understand what is happening... ATKMock uses unit tests as well, I may need to check that tomorrow in depth... Meanwhile I pushed a fix that may be enough. The issue was because I changed Boost detection earlier this week and have not tested the behavior on Windows with a fresh CMake build.
I have Boost 1.58 installed.
Tried to add SET(BOOST_ROOT C:/Developer/Libs_cpp/boost_1_58_0/boost) to the CMakeLists.txt. Does not help.
Does the build not work with newer Boost versions?