Boost and Open Frameworks

Hi,

I want to use the Boost library with Open Frameworks, In particular boost.geometry. This is a header only library, so it should be enough to add it to the include directories. This works fine when using it in a new project. However when I try to include Boost in an Open Frameworks application I get this linker error:

LNK1104 cannot open file ‘libboost_filesystem-vc140-mt-gd-1_63.lib’

Does anyone know why this happens, and how i can fix/ circumvent this?

hi,
boost is already included in openframeworks. It is used in ofFileUtils.
I’m not sure if it is the complete boost lib or just whats needed.
I suspect that the error you are getting is because of duplicated libs.
hope it helps.

Maybe your header is version 1.63 but oF uses a previous one?

Boost is indeed included in Open Frameworks, although not the full version. It only includes the libraries necessary for OF itself. I want to use the other Boost libraries, and preferably also the newest version (1.6.3) (OF uses 1.5.8).

Hi AArt,

Did you manage to find a solution to this issue? I included boost also in a project and this has through the same error.

Thanks in advance

Terry

Hi Terry,

I did manage to solve it by using the older version of boost, the same one OF uses (1.5.8). I only used header only libraries from boost, so I’m not sure if the compiled libraries also work.

good luck,

Aart

For the future Boosters, note that Boost (at least on windows) has some black magic that makes your project link the libraries even if you have not specified the libpath or input libs to the Visual Studio project. In order to disable this behaviour and specify the libs yourselves you need to define BOOST_ALL_NO_LIB

// BOOST_ALL_NO_LIB: Tells the config system not to automatically select 
// which libraries to link against.  
// Normally if a compiler supports #pragma lib, then the correct library 
// build variant will be automatically selected and linked against, 
// simply by the act of including one of that library's headers.  
// This macro turns that feature off.
// #define BOOST_ALL_NO_LIB

I haven’t checked if this is defined by default on oF

so what is the best practice to use boost API that is removed from the oF release? just extract boost 1.5.8 into libs/boost? (which I don’t think is a good idea if you work on multiple computers…)

consider also sycl

or otherwise skelcl

yes we only use a couple of features of boost until std::filesystem becomes stable with c++17 when will remove it but by now changing the boost folder with the full version is the only way to do it i’d say

1 Like