Closed traversaro closed 3 years ago
Given that only two lines of code use that function, probably this can be solved via a #ifdef
check on BOOST_VERSION, see https://stackoverflow.com/questions/47388867/how-to-selectively-include-boost-headers-depending-on-boost-version .
fyi @Nicogene @triccyx
I will check asap!
I will check asap!
No hurry, it is probably not urgent, thanks!
Apparently Boost 1.76 contains a breaking change (https://www.boost.org/users/history/version_1_76_0.html):
BREAKING CHANGE: boost::dll::import was renamed to boost::dll::import_symbol to avoid collision with C++20 import keyword.
Due to this, blocktest fails with the following error when compiled against Boost 1.76 :
../src/blocktestcore/libraryLoader.cpp: In member function 'bool BlockTestCore::LibraryLoader::load(const string&, const string&)': ../src/blocktestcore/libraryLoader.cpp:79:65: error: 'import' is not a member of 'boost::dll' 79 | boost::function<funcptr> stopFunction = boost::dll::import<funcptr>( | ^~~~~~ ../src/blocktestcore/libraryLoader.cpp:79:79: error: expected primary-expression before '>' token 79 | boost::function<funcptr> stopFunction = boost::dll::import<funcptr>( | ^ ../src/blocktestcore/libraryLoader.cpp:80:17: warning: left operand of comma operator has no effect [-Wunused-value] 80 | libraryPath, | ^~~~~~~~~~~ ../src/blocktestcore/libraryLoader.cpp:82:40: warning: right operand of comma operator has no effect [-Wunused-value] 82 | boost::dll::load_mode::rtld_lazy | ^~~~~~~~~ ../src/blocktestcore/libraryLoader.cpp:85:72: error: 'import' is not a member of 'boost::dll' 85 | boost::function<funcptr1> configureFunction = boost::dll::import<funcptr1>( | ^~~~~~ ../src/blocktestcore/libraryLoader.cpp:85:87: error: expected primary-expression before '>' token 85 | boost::function<funcptr1> configureFunction = boost::dll::import<funcptr1>(
... so I wonder why we use namespace!
I think the tricky aspect is that import
in C++20 is a keyword, so not matter in which namespace it is defined, it is problematic to use it.
@Nicogene :rocket:
Apparently Boost 1.76 contains a breaking change (https://www.boost.org/users/history/version_1_76_0.html):
Due to this, blocktest fails with the following error when compiled against Boost 1.76 :