Errors linking ceres 1.8.0 to VS2010 x64

2,138 views
Skip to first unread message

Isaac Gerg

unread,
Mar 18, 2014, 12:25:38 PM3/18/14
to ceres-...@googlegroups.com
Hey guys,  I hate these kinds of messages as much as the next guy, but I am at my end for things to try in order to resolve the linking issues I am having. 

Please help!

Thanks in advance,
Isaac

>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: char __cdecl std::basic_ios<char,struct std::char_traits<char> >::fill(char)" (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z) already defined in Logger.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __cdecl std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __cdecl std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __cdecl std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(enum std::_Uninitialized,bool)" (??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::init(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: char __cdecl std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: __cdecl std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)" (??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __cdecl std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __cdecl std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::put(char)" (?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(float)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z) already defined in Logger.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(unsigned __int64)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z) already defined in DataConditioning.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(unsigned int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __cdecl std::basic_ostream<char,struct std::char_traits<char> >::~basic_ostream<char,struct std::char_traits<char> >(void)" (??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(double)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(bool)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z) already defined in Config.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __cdecl std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z) already defined in DataConditioning.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPEBD@Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPEBD@Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcpmt.lib(uncaught.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __int64 __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Init(void)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __cdecl std::basic_iostream<char,struct std::char_traits<char> >::~basic_iostream<char,struct std::char_traits<char> >(void)" (??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __cdecl std::basic_iostream<char,struct std::char_traits<char> >::basic_iostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *)" (??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z) already defined in libcpmt.lib(ios.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char *,char *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __cdecl std::_Container_base0::_Orphan_all(void)" (?_Orphan_all@_Container_base0@std@@QEAAXXZ) already defined in Beamformer.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(void const *)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z) already defined in DiskOutputThread.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(short)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z) already defined in PingReader.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char *,char *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z) already defined in Asasin.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(__int64)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z) already defined in Logger.obj
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __cdecl std::exception::exception(char const * const &)" (??0exception@std@@QEAA@AEBQEBD@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual __cdecl std::exception::~exception(void)" (??1exception@std@@UEAA@XZ) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: memmove already defined in LIBCMT.lib(memcpy.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _time64 already defined in LIBCMT.lib(time64.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __cdecl std::exception::exception(class std::exception const &)" (??0exception@std@@QEAA@AEBV01@@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __cdecl std::exception::exception(char const * const &,int)" (??0exception@std@@QEAA@AEBQEBDH@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: free already defined in LIBCMT.lib(free.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fopen already defined in LIBCMT.lib(fopen.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fclose already defined in LIBCMT.lib(fclose.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fprintf already defined in LIBCMT.lib(fprintf.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fwrite already defined in LIBCMT.lib(fwrite.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fread already defined in LIBCMT.lib(fread.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: ftell already defined in LIBCMT.lib(ftell.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fseek already defined in LIBCMT.lib(fseek.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: ldexp already defined in LIBCMT.lib(_ldexp_.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: frexp already defined in LIBCMT.lib(_frexp_.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: rand already defined in LIBCMT.lib(rand.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __cdecl type_info::type_info(class type_info const &)" (??0type_info@@AEAA@AEBV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __cdecl type_info::operator=(class type_info const &)" (??4type_info@@AEAAAEAV0@AEBV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _vsnprintf already defined in LIBCMT.lib(vsnprint.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>MotionEstimation.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * __cdecl google::base::CheckOpMessageBuilder::NewString(void)" (__imp_?NewString@CheckOpMessageBuilder@base@google@@QEAAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>MotionEstimation.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > * __cdecl google::base::CheckOpMessageBuilder::ForVar2(void)" (__imp_?ForVar2@CheckOpMessageBuilder@base@google@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>MotionEstimation.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl google::base::CheckOpMessageBuilder::~CheckOpMessageBuilder(void)" (__imp_??1CheckOpMessageBuilder@base@google@@QEAA@XZ)
1>MotionEstimation.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl google::base::CheckOpMessageBuilder::CheckOpMessageBuilder(char const *)" (__imp_??0CheckOpMessageBuilder@base@google@@QEAA@PEBD@Z)
1>MotionEstimation.obj : error LNK2001: unresolved external symbol "public: class ceres::internal::ResidualBlock * __cdecl ceres::Problem::AddResidualBlock(class ceres::CostFunction *,class ceres::LossFunction *,double *,double *)" (?AddResidualBlock@Problem@ceres@@QEAAPEAVResidualBlock@internal@2@PEAVCostFunction@2@PEAVLossFunction@2@PEAN2@Z)
1>MotionEstimation.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > * __cdecl google::base::CheckOpMessageBuilder::ForVar1(void)" (__imp_?ForVar1@CheckOpMessageBuilder@base@google@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>C:\Users\PSU\Desktop\asasin\src\cpp\ASASIN\\..\..\..\bin\ASASIN.exe : fatal error LNK1120: 6 unresolved externals

Sameer Agarwal

unread,
Mar 18, 2014, 12:26:44 PM3/18/14
to ceres-...@googlegroups.com
Isaac,
Could you describe what your build environment is like and what libraries are you linking into?
Sameer



--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/2a94d45a-9029-4a51-876d-137395f3ec51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Isaac Gerg

unread,
Mar 18, 2014, 12:39:07 PM3/18/14
to ceres-...@googlegroups.com
Hi Sameer,

To summarize my goal, I am trying to replace our existing nlls code in our software with ceres.

I am using Visual Studio 2010 on 64 bit windows 7.  

I am attempting to compile & link in release mode. 

Libs are:
ceres.lib
libgflags.lib
libglog.lib
cudart.lib
cufft.lib
xerces-c_static_3.lib

Pre-processor defs are:
CERES_NO_LAPACK
CERES_NO_SUITESPARSE
CERES_NO_CXSPARSE
CERES_NO_GFLAGS
CERES_USE_OPENMP
GLOG_NO_ABBREVIATED_SEVERITIES
XERCES_STATIC_LIBRARY
WIN32
NDEBUG
_CONSOLE

Other headers I am using are boost, hdf5, and zeromq -- only with the addition of ceres am i getting the errors mentioned.
Isaac

Alex Stewart

unread,
Mar 18, 2014, 12:42:31 PM3/18/14
to ceres-...@googlegroups.com
Isaac,

This looks to me like you might be mixing static and dynamic CRT libraries in MSVC.

fclose already defined in LIBCMT.lib

LIBCMT is from the _static_ CRT, I suspect you may have compiled glog (and possibly other things) using the static CRT, which is causing issues when Ceres tries to link against the dynamic CRT, and glog.

As you are using MSVC, there should be an additional option: MSVC_USE_STATIC_CRT in CMake, which by default is off.

-Alex

Sameer Agarwal

unread,
Mar 18, 2014, 12:42:42 PM3/18/14
to ceres-...@googlegroups.com
On Tue, Mar 18, 2014 at 9:39 AM, Isaac Gerg <isaac...@gergltd.com> wrote:
Hi Sameer,

To summarize my goal, I am trying to replace our existing nlls code in our software with ceres.

I am using Visual Studio 2010 on 64 bit windows 7.  

I am attempting to compile & link in release mode. 

Libs are:
ceres.lib
libgflags.lib
libglog.lib
cudart.lib
cufft.lib
xerces-c_static_3.lib

Pre-processor defs are:
CERES_NO_LAPACK
CERES_NO_SUITESPARSE
CERES_NO_CXSPARSE
CERES_NO_GFLAGS
CERES_USE_OPENMP
GLOG_NO_ABBREVIATED_SEVERITIES
XERCES_STATIC_LIBRARY
WIN32
NDEBUG
_CONSOLE

First thing that caught my eye, is that its odd that you are are linking glog and gflags but you are defining CERES_NO_GFLAGS..



 

Isaac Gerg

unread,
Mar 18, 2014, 12:48:56 PM3/18/14
to ceres-...@googlegroups.com
Thanks Alex, 

I will try to recompile ceres using the static libs and see if that works.

Isaac

Isaac Gerg

unread,
Mar 18, 2014, 1:53:27 PM3/18/14
to ceres-...@googlegroups.com
Removed the flag CERES_NO_GFLAGS.  Added the flag MSVC_USE_STATIC_CRT (well, checked it, I am using cmake gui)

I get a whole slew of new errors.  Here are some of the top ones.

1>ceres.lib(partitioned_matrix_view_2_2_3.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_2_2.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_3_4.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_3_3.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_2_d.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_2_4.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_4_4.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_4_3.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl google::LogMessage::stream(void)" (__imp_?stream@LogMessage@google@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>ceres.lib(partitioned_matrix_view_2_3_d.obj) : error LNK2001: unresolved ext

Isaac Gerg

unread,
Mar 18, 2014, 1:57:46 PM3/18/14
to ceres-...@googlegroups.com
Pardon my last message -- I forgot libglog.lib.  After adding that and libgflags.lib, I am down to the following set of errors (almost there!):

1>ceres.lib(linear_least_squares_problems.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ios<char,struct std::char_traits<char> > & __cdecl std::basic_ios<char,struct std::char_traits<char> >::copyfmt(class std::basic_ios<char,struct std::char_traits<char> > const &)" (__imp_?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z)
1>ceres.lib(problem_impl.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ios<char,struct std::char_traits<char> > & __cdecl std::basic_ios<char,struct std::char_traits<char> >::copyfmt(class std::basic_ios<char,struct std::char_traits<char> > const &)" (__imp_?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z)
1>ceres.lib(program.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ios<char,struct std::char_traits<char> > & __cdecl std::basic_ios<char,struct std::char_traits<char> >::copyfmt(class std::basic_ios<char,struct std::char_traits<char> > const &)" (__imp_?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z)
1>ceres.lib(coordinate_descent_minimizer.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ios<char,struct std::char_traits<char> > & __cdecl std::basic_ios<char,struct std::char_traits<char> >::copyfmt(class std::basic_ios<char,struct std::char_traits<char> > const &)" (__imp_?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z)
1>ceres.lib(polynomial.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ios<char,struct std::char_traits<char> > & __cdecl std::basic_ios<char,struct std::char_traits<char> >::copyfmt(class std::basic_ios<char,struct std::char_traits<char> > const &)" (__imp_?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z)
1>C:\Users\PSU\Desktop\asasin\src\cpp\ASASIN\\..\..\..\bin\ASASIN.exe : fatal error LNK1120: 1 unresolved externals

Isaac Gerg

unread,
Mar 18, 2014, 3:59:51 PM3/18/14
to ceres-...@googlegroups.com
I'm stuck again.  I decided to try to solve the simpler problem of getting curve_fitting to build.  I get a slew of linking errors but here is an excerpt from the top:

>curve_fitting.obj : warning LNK4217: locally defined symbol ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z (public: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)) imported in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z)
2>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ (public: virtual __cdecl std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)) imported in function "public: void __cdecl std::basic_istream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ)
2>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ (const std::basic_ostream<char,struct std::char_traits<char> >::`vftable') imported in function "public: virtual __cdecl std::basic_iostream<char,struct std::char_traits<char> >::~basic_iostream<char,struct std::char_traits<char> >(void)" (??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ)
2>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z (protected: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::init(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)) imported in function "public: __cdecl std::basic_istream<char,struct std::char_traits<char> >::basic_istream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z)
2>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ (protected: __cdecl std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)) imported in function "public: __cdecl std::basic_istream<char,struct std::char_traits<char> >::basic_istream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z)
2>ceres.lib(partitioned_matrix_view_2_2_d.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
2>ceres.lib(partitioned_matrix_view_2_2_4.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
2>ceres.lib(partitioned_matrix_view_2_2_3.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
2>ceres.lib(partitioned_matrix_view_2_2_2.obj) : error LNK2001

Please help!

Isaac

Isaac Gerg

unread,
Mar 18, 2014, 6:10:18 PM3/18/14
to ceres-...@googlegroups.com
I have verified that i compiled glog and gflags at /Mt (multi-threaded).  Ceres is set to compile as multi-threaded as well.  Still no luck getting the thing to link.  

When I try to link helloworld, i get the following excerpt....

3>ceres.lib(schur_complement_solver.obj) : warning LNK4217: locally defined symbol ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z (public: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)) imported in function "protected: void __cdecl std::vector<int,class std::allocator<int> >::_Xlen(void)const " (?_Xlen@?$vector@HV?$allocator@H@std@@@std@@IEBAXXZ)
3>helloworld.obj : warning LNK4217: locally defined symbol ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z (public: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)) imported in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z)
3>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ (public: virtual __cdecl std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)) imported in function "public: void __cdecl std::basic_istream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ)
3>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ (const std::basic_ostream<char,struct std::char_traits<char> >::`vftable') imported in function "public: virtual __cdecl std::basic_iostream<char,struct std::char_traits<char> >::~basic_iostream<char,struct std::char_traits<char> >(void)" (??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ)
3>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z (protected: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::init(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)) imported in function "public: __cdecl std::basic_istream<char,struct std::char_traits<char> >::basic_istream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z)
3>ceres.lib(problem_impl.obj) : warning LNK4217: locally defined symbol ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ (protected: __cdecl std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)) imported in function "public: __cdecl std::basic_istream<char,struct std::char_traits<char> >::basic_istream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z)
3>ceres.lib(partitioned_matrix_view_2_2_d.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
3>ceres.lib(partitioned_matrix_view_2_2_4.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
3>ceres.lib(partitioned_matrix_view_2_2_3.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
3>ceres.lib(partitioned_matrix_view_2_2_2.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
3>ceres.lib(partitioned_matrix_view_2_3_d.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
3>ceres.lib(partitioned_matrix_view_2_3_9.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)
3>ceres.lib(partitioned_matrix_view_2_3_4.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z)


I dont understand why the declspec stuff is there -- I should be linking to the static lib?!?

Isaac

Isaac Gerg

unread,
Mar 18, 2014, 8:51:42 PM3/18/14
to ceres-...@googlegroups.com
Has anyone had any luck building Ceres using the statically linked version of libc (libcmt) in windows?

Hang Chu

unread,
Jun 20, 2014, 2:40:10 PM6/20/14
to ceres-...@googlegroups.com
Hi Isaac,

Have you solved the problem? I am having the same problem right now on my computer. I got hundreds of ceres.lib error LNK2001 when compiling helloworld...

Sameer Agarwal

unread,
Jun 20, 2014, 2:53:19 PM6/20/14
to ceres-...@googlegroups.com
could you guys try the version in git right now?
Sameer



--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

Hang Chu

unread,
Jun 20, 2014, 6:39:25 PM6/20/14
to ceres-...@googlegroups.com
Dear Sameer,

I just got the version in git, and compiled again. My previous problem is still now fixed. Here's what I've got:

I installed eigen, gflags, and glog, I did Cmake of ceres, everything worked well. Then I opened CERES.sln and built it, at first everything went well, I saw just warnings, and I can see .lib files being generated. But after generating those .lib files and when it tried to compile a project (such as helloworld), I got tons of errors, they all looked like: ceres.lib error LNK2001 ...

I checked the properties of helloworld, and I'm sure ceres.lib got linked (in my Visual Studio it's at Properties-Linker-Additional Library Directories/ Additional Dependencies).

I couldn't figure out what I've done wrong, could you help me? Thanks a lot!

Hang

Sameer Agarwal

unread,
Jun 20, 2014, 6:51:31 PM6/20/14
to ceres-...@googlegroups.com
http://en.sfml-dev.org/forums/index.php?topic=2504.0

does this have any bearing here? are some of your libraries compiled with /MT and some with /MD ?
Sameer



Hang Chu

unread,
Jun 20, 2014, 8:54:37 PM6/20/14
to ceres-...@googlegroups.com
Hi Sameer,

Thanks for the reply! I checked my gflags/glogs, and recompiled everything (twice using /MT and /MD). But neither solved my problem, still got countless LNK2001... Is there anything else that I could have missed...?

Hang

Sameer Agarwal

unread,
Jun 21, 2014, 7:29:50 PM6/21/14
to ceres-...@googlegroups.com
sorry I am all out of ideas. Though this seems to be a problem not unique to ceres. There are other reports of people facing similar problems on the internet.



Sameer

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/e5f79005-0ffd-4fcb-b22b-6d54e9850703%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages