Autolinking not working in Windows x64 cross-compile environment

All: I have taken the Boost 1.33.1 distribution [we have to stay with this for consistency with our Linux build...], along with the extra information here ( http://en.allexperts.com/q/C-1040/Building-boost-libraries-64.htm ) and been able to generate the Boost libraries using the X64 compiler on a machine running Windows XP Pro 64. I have taken the compiled libraries and copied them to our 32-bit XP Pro build machine for use in an X64 cross-compile environment. [We working on setting up a native X64 build machine, but it is a work in progress....] When I try to link, I get the list of unresolved symbols below. We use a command-line tool to do our builds, which calls "cl", "lib", "mt", and "link" directly. If I modify the link file passed to "link" such that it adds "s:\....\libboost_thread-vc80-mt-1_33_1.lib [which is the one dumpbin shows our object wants....], our DLL (omega_runtime) will link successfully. So, to my untrained eye [I'm new to building on Windows....] it looks like there is something wrong with the autolink magic. During the compilation, we do have "/DBOOST_ALL_DYN_LINK" set. Adding "/DBOOST_THREAD_USE_DLL" doesn't change anything. Does anyone have any suggestions for me on why this might be the case, or how to track it down? I have added the lib directory to both LIB and LIBPATH but that doesn't appear to change the situation. Thanks in advance. Cheers, Dave Creating library com\westerngeco\omega\runtime\omega_runtime.lib and object com\westerngeco\omega\runtime\omega_runtime.exp Thread.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::mutex::mutex(void)" (??0mutex@boost@@QEAA@XZ) referenced in f unction "void __cdecl com::westerngeco::omega::runtime::`anonymous namespace'::classInit(void)" (?classInit@?A0xe5577335@runtime@omega@weste rngeco@com@@YAXXZ) ResourceUsage.obj : error LNK2001: unresolved external symbol "public: __cdecl boost::mutex::mutex(void)" (??0mutex@boost@@QEAA@XZ) Thread.obj : error LNK2019: unresolved external symbol "void __cdecl boost::call_once(void (__cdecl*)(void),long &)" (?call_once@boost@@YAXP 6AXXZAEAJ@Z) referenced in function "public: static int __cdecl com::westerngeco::omega::runtime::Thread::currentGroup(void)" (?currentGroup @Thread@runtime@omega@westerngeco@com@@SAHXZ) Thread.obj : error LNK2019: unresolved external symbol "public: void * __cdecl boost::detail::tss::get(void)const " (?get@tss@detail@boost@@ QEBAPEAXXZ) referenced in function "public: class com::westerngeco::omega::runtime::ThreadHandle * __cdecl boost::thread_specific_ptr<class com::westerngeco::omega::runtime::ThreadHandle>::get(void)const " (?get@?$thread_specific_ptr@VThreadHandle@runtime@omega@westerngeco@com@@@ boost@@QEBAPEAVThreadHandle@runtime@omega@westerngeco@com@@XZ) Thread.obj : error LNK2019: unresolved external symbol "public: void __cdecl boost::detail::tss::cleanup(void *)" (?cleanup@tss@detail@boost @@QEAAXPEAX@Z) referenced in function "public: void __cdecl boost::thread_specific_ptr<class com::westerngeco::omega::runtime::ThreadHandle> ::reset(class com::westerngeco::omega::runtime::ThreadHandle *)" (?reset@?$thread_specific_ptr@VThreadHandle@runtime@omega@westerngeco@com@@ @boost@@QEAAXPEAVThreadHandle@runtime@omega@westerngeco@com@@@Z) Thread.obj : error LNK2019: unresolved external symbol "public: void __cdecl boost::detail::tss::set(void *)" (?set@tss@detail@boost@@QEAAXP EAX@Z) referenced in function "public: void __cdecl boost::thread_specific_ptr<class com::westerngeco::omega::runtime::ThreadHandle>::reset( class com::westerngeco::omega::runtime::ThreadHandle *)" (?reset@?$thread_specific_ptr@VThreadHandle@runtime@omega@westerngeco@com@@@boost@@ QEAAXPEAVThreadHandle@runtime@omega@westerngeco@com@@@Z) Thread.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::lock_error::lock_error(void)" (??0lock_error@boost@@QEAA@XZ) referenced in function "public: void __cdecl boost::detail::thread::scoped_lock<class boost::mutex>::lock(void)" (?lock@?$scoped_lock@Vmutex @boost@@@thread@detail@boost@@QEAAXXZ) ResourceUsage.obj : error LNK2001: unresolved external symbol "public: __cdecl boost::lock_error::lock_error(void)" (??0lock_error@boost@@QE AA@XZ) Thread.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl boost::lock_error::~lock_error(void)" (??1lock_error@boost@@ UEAA@XZ) ResourceUsage.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl boost::lock_error::~lock_error(void)" (??1lock_error@ boost@@UEAA@XZ) Thread.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl boost::thread_exception::~thread_exception(void)" (??1thread _exception@boost@@UEAA@XZ) referenced in function "public: virtual void * __cdecl boost::thread_exception::`scalar deleting destructor'(unsi gned int)" (??_Gthread_exception@boost@@UEAAPEAXI@Z) ResourceUsage.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl boost::thread_exception::~thread_exception(void)" (?? 1thread_exception@boost@@UEAA@XZ) Thread.obj : error LNK2001: unresolved external symbol "public: virtual char const * __cdecl boost::lock_error::what(void)const " (?what@loc k_error@boost@@UEBAPEBDXZ) ResourceUsage.obj : error LNK2001: unresolved external symbol "public: virtual char const * __cdecl boost::lock_error::what(void)const " (?w hat@lock_error@boost@@UEBAPEBDXZ) Thread.obj : error LNK2019: unresolved external symbol "private: void __cdecl boost::mutex::do_lock(void)" (?do_lock@mutex@boost@@AEAAXXZ) r eferenced in function "public: static void __cdecl boost::detail::thread::lock_ops<class boost::mutex>::lock(class boost::mutex &)" (?lock@? $lock_ops@Vmutex@boost@@@thread@detail@boost@@SAXAEAVmutex@4@@Z) ResourceUsage.obj : error LNK2001: unresolved external symbol "private: void __cdecl boost::mutex::do_lock(void)" (?do_lock@mutex@boost@@AEA AXXZ) Thread.obj : error LNK2019: unresolved external symbol "private: void __cdecl boost::mutex::do_unlock(void)" (?do_unlock@mutex@boost@@AEAAXX Z) referenced in function "public: static void __cdecl boost::detail::thread::lock_ops<class boost::mutex>::unlock(class boost::mutex &)" (? unlock@?$lock_ops@Vmutex@boost@@@thread@detail@boost@@SAXAEAVmutex@4@@Z) ResourceUsage.obj : error LNK2001: unresolved external symbol "private: void __cdecl boost::mutex::do_unlock(void)" (?do_unlock@mutex@boost@ @AEAAXXZ) Thread.obj : error LNK2019: unresolved external symbol "private: void __cdecl boost::detail::tss::init(class boost::function1<void,void *,cl ass std::allocator<class boost::function_base> > *)" (?init@tss@detail@boost@@AEAAXPEAV?$function1@XPEAXV?$allocator@Vfunction_base@boost@@@ std@@@3@@Z) referenced in function "public: __cdecl boost::detail::tss::tss(class boost::function1<void,void *,class std::allocator<class bo ost::function_base> > *)" (??0tss@detail@boost@@QEAA@PEAV?$function1@XPEAXV?$allocator@Vfunction_base@boost@@@std@@@2@@Z) Thread.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::thread_resource_error::thread_resource_error(void)" (??0threa d_resource_error@boost@@QEAA@XZ) referenced in function "public: __cdecl boost::detail::tss::tss(class boost::function1<void,void *,class st d::allocator<class boost::function_base> > *)" (??0tss@detail@boost@@QEAA@PEAV?$function1@XPEAXV?$allocator@Vfunction_base@boost@@@std@@@2@@ Z) Thread.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl boost::thread_resource_error::~thread_resource_error(void)" (??1thread_resource_error@boost@@UEAA@XZ) Thread.obj : error LNK2001: unresolved external symbol "public: virtual char const * __cdecl boost::thread_resource_error::what(void)const " (?what@thread_resource_error@boost@@UEBAPEBDXZ) lib\omega_runtime.dll : fatal error LNK1120: 15 unresolved externals Error status returned = 1120

Dave Barnett wrote:
All:
I have taken the Boost 1.33.1 distribution [we have to stay with this for consistency with our Linux build...], along with the extra information here ( http://en.allexperts.com/q/C-1040/Building-boost-libraries-64.htm ) and been able to generate the Boost libraries using the X64 compiler on a machine running Windows XP Pro 64.
I have taken the compiled libraries and copied them to our 32-bit XP Pro build machine for use in an X64 cross-compile environment. [We working on setting up a native X64 build machine, but it is a work in progress....]
When I try to link, I get the list of unresolved symbols below. We use a command-line tool to do our builds, which calls "cl", "lib", "mt", and "link" directly. If I modify the link file passed to "link" such that it adds "s:\....\libboost_thread-vc80-mt-1_33_1.lib [which is the one dumpbin shows our object wants....], our DLL (omega_runtime) will link successfully.
So, to my untrained eye [I'm new to building on Windows....] it looks like there is something wrong with the autolink magic.
Can you try defining BOOST_LIB_DIAGNOSTIC when building as that will print out the name of the library being selected to link against. Possible causes might be: * _DEBUG is being explicitly defined even though you're actually linking to the release runtime (in which case it shouldn't be). * You've actually got the 32-bit binaries in your lib search path. HTH, John.
participants (2)
-
Dave Barnett
-
John Maddock