diff --git a/src/cpp/multisolver_interface/CMakeLists.txt b/src/cpp/multisolver_interface/CMakeLists.txt index b12d262a4..724001607 100644 --- a/src/cpp/multisolver_interface/CMakeLists.txt +++ b/src/cpp/multisolver_interface/CMakeLists.txt @@ -53,17 +53,19 @@ target_include_directories (solvers ${xpansion_interfaces_path} ) - +target_link_libraries(solvers + PUBLIC + ${CMAKE_DL_LIBS} +) #CLP-CBC if(COIN_OR) target_link_libraries (solvers - PUBLIC + PRIVATE Coin::Clp Coin::Cgl Coin::CoinUtils Coin::Osi Coin::Cbc - ${CMAKE_DL_LIBS} ) endif() diff --git a/src/cpp/multisolver_interface/environment.cc b/src/cpp/multisolver_interface/environment.cc index b8e65003f..86c157e4c 100644 --- a/src/cpp/multisolver_interface/environment.cc +++ b/src/cpp/multisolver_interface/environment.cc @@ -21,6 +21,9 @@ #include #include +namespace Solver { +class DynamicLibrary; +} namespace LoadXpress { #define STRINGIFY2(X) #X @@ -141,7 +144,7 @@ std::function XPRSgetintattrib = XpressLoader::XpressLoader(std::shared_ptr logger) : logger_(std::move(logger)) {} -bool XpressLoader::LoadXpressFunctions(DynamicLibrary* xpress_dynamic_library) { +bool XpressLoader::LoadXpressFunctions(Solver::DynamicLibrary* xpress_dynamic_library) { // This was generated with the parse_header_xpress.py script. // See the comment at the top of the script. @@ -299,7 +302,7 @@ bool XpressLoader::LoadXpressDynamicLibrary(std::string& xpresspath) { static std::string xpress_lib_path; static std::once_flag xpress_loading_done; static bool ret; - static DynamicLibrary xpress_library; + static Solver::DynamicLibrary xpress_library; // static std::mutex mutex; // mutex.lock(); diff --git a/src/cpp/multisolver_interface/include/multisolver_interface/dynamic_library.h b/src/cpp/multisolver_interface/include/multisolver_interface/dynamic_library.h index fd5909995..a333a86c5 100644 --- a/src/cpp/multisolver_interface/include/multisolver_interface/dynamic_library.h +++ b/src/cpp/multisolver_interface/include/multisolver_interface/dynamic_library.h @@ -26,6 +26,7 @@ #include #endif +namespace Solver { class DynamicLibrary { static constexpr size_t kMaxFunctionsNotFound = 10; @@ -111,5 +112,6 @@ class DynamicLibrary { } }; }; +} #endif // OR_TOOLS_BASE_DYNAMIC_LIBRARY_H_ diff --git a/src/cpp/multisolver_interface/include/multisolver_interface/environment.h b/src/cpp/multisolver_interface/include/multisolver_interface/environment.h index 022e8cfc5..fc9041d01 100644 --- a/src/cpp/multisolver_interface/include/multisolver_interface/environment.h +++ b/src/cpp/multisolver_interface/include/multisolver_interface/environment.h @@ -59,7 +59,7 @@ class XpressLoader { std::vector XpressDynamicLibraryPotentialPaths(); std::string GetXpressVarFromEnvironmentVariables(const char* XPRESS_var, bool verbose = true); - bool LoadXpressFunctions(DynamicLibrary* xpress_dynamic_library); + bool LoadXpressFunctions(Solver::DynamicLibrary* xpress_dynamic_library); int loadLicence(const std::string& lib_path, bool verbose); };