Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ SEARCH_FOR_BOOST()
# Libtool dynamic loading
# This project does not use Libtool directly but still uses ltdl for
# plug-in loading.
SET(LIB_LTDL LIB_LTDL-NOTFOUND)
FIND_LIBRARY(LIB_LTDL libltdl${CMAKE_SHARED_LIBRARY_SUFFIX})
IF (NOT LIB_LTDL)
MESSAGE(FATAL_ERROR
"Failed to find Libtool ltdl library, check that Libtool ltdl is installed.")
ENDIF()
INCLUDE(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(ltdl.h LTDL_H_FOUND)
IF (NOT LTDL_H_FOUND)
MESSAGE(FATAL_ERROR
"Failed to find ltdl.h, check that Libtool ltdl is installed.")
IF(NOT WIN32)
SET(LIB_LTDL LIB_LTDL-NOTFOUND)
FIND_LIBRARY(LIB_LTDL libltdl${CMAKE_SHARED_LIBRARY_SUFFIX})
IF (NOT LIB_LTDL)
MESSAGE(FATAL_ERROR
"Failed to find Libtool ltdl library, check that Libtool ltdl is installed.")
ENDIF()
CHECK_INCLUDE_FILE_CXX(ltdl.h LTDL_H_FOUND)
IF (NOT LTDL_H_FOUND)
MESSAGE(FATAL_ERROR
"Failed to find ltdl.h, check that Libtool ltdl is installed.")
ENDIF()
ENDIF()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With ltld-win32, we can use this, i.e. pkg-config check on Windows, and fallback to the current check for other platforms.


# Search for roboptim-core.
Expand Down
2 changes: 1 addition & 1 deletion cmake
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MACRO(IPOPT_PLUGIN NAME)
INSTALL(TARGETS roboptim-core-plugin-${NAME}
DESTINATION ${PLUGINDIR})
PKG_CONFIG_USE_DEPENDENCY(roboptim-core-plugin-${NAME} ipopt)
PKG_CONFIG_USE_COMPILE_DEPENDENCY(roboptim-core-plugin-${NAME} roboptim-core)
PKG_CONFIG_USE_DEPENDENCY(roboptim-core-plugin-${NAME} roboptim-core)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except plugins do not need to be linked with roboptim-core. What was the error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the link, there is a lot of missing symbols :


ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::incindent(class std::basic_ostream > &)" (__imp_?incindent@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z) referenced in function "public: void __cdecl roboptim::detail::printConstraint >::operator() > >(class boost::shared_ptr > const &)" (??$?RV?$shared_ptr@V?$GenericFunction@UEigenMatrixDense@roboptim@@@roboptim@@@boost@@@?$printConstraint@V?$Problem@UEigenMatrixDense@roboptim@@@roboptim@@@detail@roboptim@@QEAAXAEBV?$shared_ptr@V?$GenericFunction@UEigenMatrixDense@roboptim@@@roboptim@@@boost@@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::incindent(class std::basic_ostream > &)" (__imp_?incindent@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::decindent(class std::basic_ostream > &)" (__imp_?decindent@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z) referenced in function "public: void __cdecl roboptim::detail::printConstraint >::operator() > >(class boost::shared_ptr > const &)" (??$?RV?$shared_ptr@V?$GenericFunction@UEigenMatrixDense@roboptim@@@roboptim@@@boost@@@?$printConstraint@V?$Problem@UEigenMatrixDense@roboptim@@@roboptim@@@detail@roboptim@@QEAAXAEBV?$shared_ptr@V?$GenericFunction@UEigenMatrixDense@roboptim@@@roboptim@@@boost@@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::decindent(class std::basic_ostream > &)" (__imp_?decindent@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::iendl(class std::basic_ostream > &)" (__imp_?iendl@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z) referenced in function "public: void __cdecl roboptim::detail::printConstraint >::operator() > >(class boost::shared_ptr > const &)" (??$?RV?$shared_ptr@V?$GenericFunction@UEigenMatrixDense@roboptim@@@roboptim@@@boost@@@?$printConstraint@V?$Problem@UEigenMatrixDense@roboptim@@@roboptim@@@detail@roboptim@@QEAAXAEBV?$shared_ptr@V?$GenericFunction@UEigenMatrixDense@roboptim@@@roboptim@@@boost@@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::iendl(class std::basic_ostream > &)" (__imp_?iendl@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::incendl(class std::basic_ostream > &)" (__imp_?incendl@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z) referenced in function "public: class std::basic_ostream > & __cdecl roboptim::Problem::print(class std::basic_ostream > &)const " (?print@?$Problem@UEigenMatrixDense@roboptim@@@roboptim@@QEBAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV34@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::incendl(class std::basic_ostream > &)" (__imp_?incendl@roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_string,class std::allocator > const __cdecl roboptim::demangle(char const *)" (__imp_?demangle@roboptim@@YA?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBD@Z) referenced in function "class std::basic_string,class std::allocator > __cdecl roboptim::typeString >(void)" (??$typeString@V?$GenericDifferentiableFunction@UEigenMatrixDense@roboptim@@@roboptim@@@roboptim@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::SolverWarning::SolverWarning(class std::basic_string,class std::allocator > const &)" (__imp_??0SolverWarning@roboptim@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual void __cdecl roboptim::detail::Tnlp::finalize_solution(enum Ipopt::SolverReturn,int,double const *,double const *,double const *,int,double const *,double const *,double,class Ipopt::IpoptData const *,class Ipopt::IpoptCalculatedQuantities *)" (?finalize_solution@?$Tnlp@VIpoptSolver@roboptim@@@detail@roboptim@@UEAAXW4SolverReturn@Ipopt@@HPEBN11H11NPEBVIpoptData@5@PEAVIpoptCalculatedQuantities@5@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl roboptim::SolverWarning::~SolverWarning(void)" (__imp_??1SolverWarning@roboptim@@UEAA@XZ) referenced in function "public: virtual void * __cdecl roboptim::SolverWarning::`scalar deleting destructor'(unsigned int)" (??_GSolverWarning@roboptim@@UEAAPEAXI@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::SolverWarning::SolverWarning(class roboptim::SolverWarning &&)" (__imp_??0SolverWarning@roboptim@@QEAA@$$QEAV01@@Z) referenced in function "class roboptim::SolverWarning * __cdecl std::_Uninit_move,class roboptim::SolverWarning>(class roboptim::SolverWarning *,class roboptim::SolverWarning *,class roboptim::SolverWarning *,struct std::_Wrap_alloc > &,class roboptim::SolverWarning *,struct std::_Nonscalar_ptr_iterator_tag)" (??$_Uninit_move@PEAVSolverWarning@roboptim@@PEAV12@V?$allocator@VSolverWarning@roboptim@@@std@@V12@@std@@YAPEAVSolverWarning@roboptim@@PEAV12@00AEAU?$_Wrap_alloc@V?$allocator@VSolverWarning@roboptim@@@std@@@0@0U_Nonscalar_ptr_iterator_tag@0@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::Result::Result(__int64,__int64)" (__imp_??0Result@roboptim@@QEAA@_J0@Z) referenced in function "public: virtual void __cdecl roboptim::detail::Tnlp::finalize_solution(enum Ipopt::SolverReturn,int,double const *,double const *,double const *,int,double const *,double const *,double,class Ipopt::IpoptData const *,class Ipopt::IpoptCalculatedQuantities *)" (?finalize_solution@?$Tnlp@VIpoptSolver@roboptim@@@detail@roboptim@@UEAAXW4SolverReturn@Ipopt@@HPEBN11H11NPEBVIpoptData@5@PEAVIpoptCalculatedQuantities@5@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl roboptim::Result::~Result(void)" (__imp_??1Result@roboptim@@UEAA@XZ) referenced in function "public: virtual void * __cdecl roboptim::Result::`scalar deleting destructor'(unsigned int)" (??_GResult@roboptim@@UEAAPEAXI@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::Result::Result(class roboptim::Result const &)" (__imp_??0Result@roboptim@@QEAA@AEBV01@@Z) referenced in function "public: __cdecl boost::variant::variant(class roboptim::Result const &)" (??$?0VResult@roboptim@@@?$variant@VNoSolution@roboptim@@VResult@2@VSolverError@2@VResultWithWarnings@2@Uvoid_@0detail@boost@@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@@boost@@QEAA@AEBVResult@roboptim@@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class roboptim::Result & __cdecl roboptim::Result::operator=(class roboptim::Result const &)" (__imp_??4Result@roboptim@@QEAAAEAV01@AEBV01@@Z) referenced in function "public: bool __cdecl boost::variant::apply_visitor >(class boost::detail::variant::direct_assigner &)" (??$apply_visitor@V?$direct_assigner@VResult@roboptim@@@variant@detail@boost@@@?$variant@VNoSolution@roboptim@@VResult@2@VSolverError@2@VResultWithWarnings@2@Uvoid_@0detail@boost@@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@@boost@@QEAA_NAEAV?$direct_assigner@VResult@roboptim@@@variant@detail@1@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,class roboptim::Result const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBVResult@0@@Z) referenced in function "public: void __cdecl boost::detail::variant::printer > >::operator()(class roboptim::Result const &)const " (??$?RVResult@roboptim@@@?$printer@V?$basic_ostream@DU?$char_traits@D@std@@@std@@@variant@detail@boost@@QEBAXAEBVResult@roboptim@@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,class roboptim::Result const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBVResult@0@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::SolverError::SolverError(class std::basic_string,class std::allocator > const &,class roboptim::Result const &)" (__imp_??0SolverError@roboptim@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVResult@1@@Z) referenced in function "public: virtual void __cdecl roboptim::detail::Tnlp::finalize_solution(enum Ipopt::SolverReturn,int,double const *,double const *,double const *,int,double const *,double const *,double,class Ipopt::IpoptData const *,class Ipopt::IpoptCalculatedQuantities *)" (?finalize_solution@?$Tnlp@VIpoptSolver@roboptim@@@detail@roboptim@@UEAAXW4SolverReturn@Ipopt@@HPEBN11H11NPEBVIpoptData@5@PEAVIpoptCalculatedQuantities@5@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::SolverError::SolverError(class roboptim::SolverError const &)" (__imp_??0SolverError@roboptim@@QEAA@AEBV01@@Z) referenced in function "public: __cdecl boost::variant::variant(class roboptim::SolverError &&,void *,void *)" (??$?0VSolverError@roboptim@@@?$variant@VNoSolution@roboptim@@VResult@2@VSolverError@2@VResultWithWarnings@2@Uvoid_@0detail@boost@@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@@boost@@QEAA@$$QEAVSolverError@roboptim@@PEAX1@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl roboptim::SolverError::~SolverError(void)" (__imp_??1SolverError@roboptim@@UEAA@XZ) referenced in function "public: virtual void * __cdecl roboptim::SolverError::`scalar deleting destructor'(unsigned int)" (??_GSolverError@roboptim@@UEAAPEAXI@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class roboptim::SolverError & __cdecl roboptim::SolverError::operator=(class roboptim::SolverError const &)" (__imp_??4SolverError@roboptim@@QEAAAEAV01@AEBV01@@Z) referenced in function "public: bool __cdecl boost::variant::apply_visitor >(class boost::detail::variant::direct_mover &)" (??$apply_visitor@V?$direct_mover@VSolverError@roboptim@@@variant@detail@boost@@@?$variant@VNoSolution@roboptim@@VResult@2@VSolverError@2@VResultWithWarnings@2@Uvoid_@0detail@boost@@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@@boost@@QEAA_NAEAV?$direct_mover@VSolverError@roboptim@@@variant@detail@1@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,class roboptim::SolverError const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBVSolverError@0@@Z) referenced in function "public: void __cdecl boost::detail::variant::printer > >::operator()(class roboptim::SolverError const &)const " (??$?RVSolverError@roboptim@@@?$printer@V?$basic_ostream@DU?$char_traits@D@std@@@std@@@variant@detail@boost@@QEBAXAEBVSolverError@roboptim@@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,class roboptim::SolverError const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBVSolverError@0@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl roboptim::ResultWithWarnings::~ResultWithWarnings(void)" (__imp_??1ResultWithWarnings@roboptim@@UEAA@XZ) referenced in function "public: virtual void * __cdecl roboptim::ResultWithWarnings::`scalar deleting destructor'(unsigned int)" (??_GResultWithWarnings@roboptim@@UEAAPEAXI@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::ResultWithWarnings::ResultWithWarnings(class roboptim::ResultWithWarnings const &)" (__imp_??0ResultWithWarnings@roboptim@@QEAA@AEBV01@@Z) referenced in function "private: void __cdecl boost::variant::move_assigner::assign_impl(class roboptim::ResultWithWarnings &,struct boost::mpl::bool_<0>,struct boost::mpl::bool_<0>,struct boost::mpl::bool_<1>)const " (??$assign_impl@VResultWithWarnings@roboptim@@@move_assigner@?$variant@VNoSolution@roboptim@@VResult@2@VSolverError@2@VResultWithWarnings@2@Uvoid_@0detail@boost@@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@U6078@@boost@@AEBAXAEAVResultWithWarnings@roboptim@@U?$bool_@$0A@@mpl@2@1U?$bool_@$00@62@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class roboptim::ResultWithWarnings & __cdecl roboptim::ResultWithWarnings::operator=(class roboptim::ResultWithWarnings const &)" (__imp_??4ResultWithWarnings@roboptim@@QEAAAEAV01@AEBV01@@Z) referenced in function "public: void __cdecl boost::detail::variant::move_storage::internal_visit(class roboptim::ResultWithWarnings &,int)const " (??$internal_visit@VResultWithWarnings@roboptim@@@move_storage@variant@detail@boost@@QEBAXAEAVResultWithWarnings@roboptim@@H@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::GenericSolver::GenericSolver(void)" (__imp_??0GenericSolver@roboptim@@QEAA@XZ) referenced in function "public: __cdecl roboptim::Solver::Solver(class roboptim::Problem const &)" (??0?$Solver@UEigenMatrixDense@roboptim@@@roboptim@@QEAA@AEBV?$Problem@UEigenMatrixDense@roboptim@@@1@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::GenericSolver::GenericSolver(void)" (__imp_??0GenericSolver@roboptim@@QEAA@XZ)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::GenericSolver::GenericSolver(class roboptim::GenericSolver const &)" (__imp_??0GenericSolver@roboptim@@QEAA@AEBV01@@Z) referenced in function "public: __cdecl roboptim::Solver::Solver(class roboptim::Solver const &)" (??0?$Solver@UEigenMatrixDense@roboptim@@@roboptim@@QEAA@AEBV01@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::GenericSolver::GenericSolver(class roboptim::GenericSolver const &)" (__imp_??0GenericSolver@roboptim@@QEAA@AEBV01@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl roboptim::GenericSolver::~GenericSolver(void)" (__imp_??1GenericSolver@roboptim@@UEAA@XZ) referenced in function "int `public: __cdecl roboptim::Solver::Solver(class Solver::dtor$0 const &)'::`1'::dtor$0" (?dtor$0@?0???0?$Solver@UEigenMatrixDense@roboptim@@@roboptim@@QEAA@AEBV01@@Z@4HA)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl roboptim::GenericSolver::~GenericSolver(void)" (__imp_??1GenericSolver@roboptim@@UEAA@XZ)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,class roboptim::NoSolution const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBVNoSolution@0@@Z) referenced in function "public: void __cdecl boost::detail::variant::printer > >::operator()(class roboptim::NoSolution const &)const " (??$?RVNoSolution@roboptim@@@?$printer@V?$basic_ostream@DU?$char_traits@D@std@@@std@@@variant@detail@boost@@QEBAXAEBVNoSolution@roboptim@@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,class roboptim::NoSolution const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBVNoSolution@0@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl roboptim::Parameter::Parameter(void)" (__imp_??0Parameter@roboptim@@QEAA@XZ) referenced in function "public: __cdecl std::pair,class std::allocator > const ,struct roboptim::Parameter>::pair,class std::allocator > const ,struct roboptim::Parameter>,class std::allocator > &&>(struct std::piecewise_construct_t,class std::tuple,class std::allocator > &&>,class std::tuple<>)" (??$?0$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$Z$$V@?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UParameter@roboptim@@@std@@QEAA@Upiecewise_construct_t@1@V?$tuple@$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@V?$tuple@$$V@1@@Z)

ipopt.cc.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,struct roboptim::Parameter const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBUParameter@0@@Z) referenced in function "public: virtual class std::basic_ostream > & __cdecl roboptim::Solver::print(class std::basic_ostream > &)const " (?print@?$Solver@UEigenMatrixDense@roboptim@@@roboptim@@UEBAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV34@@Z)

tnlp.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream > & __cdecl roboptim::operator<<(class std::basic_ostream > &,struct roboptim::Parameter const &)" (__imp_??6roboptim@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBUParameter@0@@Z)

ipopt.cc.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_ostream > & __cdecl roboptim::Result::print(class std::basic_ostream > &)const " (?print@Result@roboptim@@UEBAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV34@@Z)

ipopt.cc.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_ostream > & __cdecl roboptim::SolverError::print(class std::basic_ostream > &)const " (?print@SolverError@roboptim@@UEBAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV34@@Z)

ipopt.cc.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_ostream > & __cdecl roboptim::SolverWarning::print(class std::basic_ostream > &)const " (?print@SolverWarning@roboptim@@UEBAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV34@@Z)

roboptim-core-plugin-ipopt.dll : fatal error LNK1120: 30 unresolved externals

Copy link
Member

@bchretien bchretien Jun 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those symbols should come from the main library/executable that loads the plugin, i.e. at runtime. This is what happens on Linux/Mac OS X. According to the dlopen doc:

The mode parameter describes how dlopen() shall operate upon file with respect to the processing of relocations and the scope of visibility of the symbols provided within file. When an executable object file is brought into the address space of a process, it may contain references to symbols whose addresses are not known until the executable object file is loaded.

These references shall be relocated before the symbols can be accessed. The mode parameter governs when these relocations take place and may have the following values:

RTLD_LAZY
Relocations shall be performed at an implementation-defined time, ranging from the time of the dlopen() call until the first reference to a given symbol occurs. Specifying RTLD_LAZY should improve performance on implementations supporting dynamic symbol binding since a process might not reference all of the symbols in an executable object file. And, for systems supporting dynamic symbol resolution for normal process execution, this behavior mimics the normal handling of process execution.
RTLD_NOW
All necessary relocations shall be performed when the executable object file is first loaded. This may waste some processing if relocations are performed for symbols that are never referenced. This behavior may be useful for applications that need to know that all symbols referenced during execution will be available before dlopen() returns.

This can be easily confirmed with nm -CD roboptim-core-plugin-ipopt.so | grep "U roboptim::" on Linux (ltdl uses RTLD_LAZY).

Now, before doing any change to this, I would like to know more about the differences with Windows. Can we achieve the same behavior with dlopen and LoadLibrary (called by ltdl)? A quick search seems to indicate that this is a shortcoming of MSVC... Do you confirm this?


# Make sure all symbols are defined.
# See:
Expand Down
2 changes: 1 addition & 1 deletion tests/shared-tests
Submodule shared-tests updated 3 files
+3 −0 common.hh
+1 −1 common/starting-point.cc
+8 −9 tests.cmake