Boost Python not linking uder Cygwin

Apologies for resending this email ... but for some reason my last email ended up as a reply for a completely disconnected subject.... TWICE. I am able to build my Python Extension Module under MSVC 7.1, MSVC 8.0 and GCC (LINUX). However I cannot seem to build it under Cygwin gcc. The output of uname is CYGWIN_NT-5.1 The output of gcc -v is : Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/ info --enable-languages=c,ada,c++,d,f77,java,objc --enable-nls --without-included-gettext --enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib ble-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debug : (r gured) Thread model: posix gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) My compile command line is : g++ -o /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/PythonPapa.dll -shared /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/main.os /cygdrive/c/Build/cygwin/gcc/3. .4/Debug/Intermediate/PythonPapa/StdVector.os -L/cygdrive/c/Build/cygwin/gcc/3.4.4/Debug -L/usr/local/lib -L/lib/python2.4/config -lPapaGateWay -lboost_python-gcc-mt-d-1_33_1 -lpython2.4 -lPapaGa eWay Then there are ALOT of errors .. here are the last few lines : /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorIdSaIdEES5_ED1Ev[boost::python::objects::pointer_holder<std::vector< double, std::allocator<double> >*, std::vector<double, std::allocator<double> > >::~pointer_holder()]+0x16): undefined reference to `__imp___ZN5boost6python15instance_holderD2Ev' /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorIdSaIdEES5_ED0Ev[boost::python::objects::pointer_holder<std::vector< double, std::allocator<double> >*, std::vector<double, std::allocator<double> > >::~pointer_holder()]+0x16): undefined reference to `__imp___ZN5boost6python15instance_holderD2Ev' /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorImSaImEES5_ED1Ev[boost::python::objects::pointer_holder<std::vector< unsigned long, std::allocator<unsigned long> >*, std::vector<unsigned long, std::allocator<unsigned long> > >::~pointer_holder()]+0x16): undefined reference to `__imp___ZN5boost6python15instance_holde rD2Ev' /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorImSaImEES5_ED0Ev[boost::python::objects::pointer_holder<std::vector< unsigned long, std::allocator<unsigned long> >*, std::vector<unsigned long, std::allocator<unsigned long> > >::~pointer_holder()]+0x16): undefined reference to `__imp___ZN5boost6python15instance_holde rD2Ev' /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorIN17__papa__namespace16pTemplateVariantINS4_14pTemplateArrayIdEENS4_ 15pTemplateMatrixIdEEEESaISA_EESC_ED1Ev[boost::python::objects::pointer_holder<std::vector<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMa trix<double> >, std::allocator<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMatrix<double> > > >*, std::vector<__papa__namespace::pTemplat eVariant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMatrix<double> >, std::allocator<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__ namespace::pTemplateMatrix<double> > > > >::~pointer_holder()]+0x16): undefined reference to `__imp___ZN5boost6python15instance_holderD2Ev' /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/StdVector.os:/usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderI PSt6vectorIN17__papa__namespace16pTemplateVariantINS4_14pTemplateArrayIdEENS4_15pTemplateMatrixIdEEEESaISA_EESC_ED0Ev[boost::python::objects::pointer_holder<std::vector<__papa__namespace::pTemplateVar iant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMatrix<double> >, std::allocator<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__name space::pTemplateMatrix<double> > > >*, std::vector<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMatrix<double> >, std::allocator<__papa__n amespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMatrix<double> > > > >::~pointer_holder()]+0x16): more undefined references to `__imp___ZN5boost6pytho n15instance_holderD2Ev' follow /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/StdVector.os: In function `_ZN5boost6python7objects17make_ptr_instanceIN17__papa__namespace16pTemplateVariantINS3_14pTemplateArrayIdEEN S3_15pTemplateMatrixIdEEEENS1_14pointer_holderIPS9_S9_EEE9constructISB_EEPSC_PvP7_objectRT_': /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorIN17__papa__namespace16pTemplateVariantINS4_14pTemplateArrayIdEENS4_ 15pTemplateMatrixIdEEEESaISA_EESC_E5holdsENS0_9type_infoEb[boost::python::objects::pointer_holder<std::vector<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__nam espace::pTemplateMatrix<double> >, std::allocator<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMatrix<double> > > >*, std::vector<__papa__ namespace::pTemplateVariant<__papa__namespace::pTemplateArray<double>, __papa__namespace::pTemplateMatrix<double> >, std::allocator<__papa__namespace::pTemplateVariant<__papa__namespace::pTemplateArra y<double>, __papa__namespace::pTemplateMatrix<double> > > > >::holds(boost::python::type_info, bool)]+0xea): undefined reference to `__imp___ZN5boost6python7objects17find_dynamic_typeEPvNS0_9type_info ES3_' /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorImSaImEES5_E5holdsENS0_9type_infoEb[boost::python::objects::pointer_ holder<std::vector<unsigned long, std::allocator<unsigned long> >*, std::vector<unsigned long, std::allocator<unsigned long> > >::holds(boost::python::type_info, bool)]+0xea): undefined reference to ` __imp___ZN5boost6python7objects17find_dynamic_typeEPvNS0_9type_infoES3_' /usr/local/include/boost-1_33_1/boost/python/object/make_ptr_instance.hpp:(.text$_ZN5boost6python7objects14pointer_holderIPSt6vectorIdSaIdEES5_E5holdsENS0_9type_infoEb[boost::python::objects::pointer_ holder<std::vector<double, std::allocator<double> >*, std::vector<double, std::allocator<double> > >::holds(boost::python::type_info, bool)]+0xea): undefined reference to `__imp___ZN5boost6python7obje cts17find_dynamic_typeEPvNS0_9type_infoES3_' collect2: ld returned 1 exit status Also I expected to see an import library build for the boost_python.dll, but i can't see that it is .. this is the contents of my /usr/local/lib libboost_python-gcc-1_33_1.a libboost_python-gcc-d-1_33_1.dll libboost_python-gcc-mt-1_33_1.dll libboost_python-gcc-mt-d.a libcppunit.a libboost_python-gcc-1_33_1.dll libboost_python-gcc-d.a libboost_python-gcc-mt-d-1_33_1.a libboost_python-gcc-mt.a libcppunit.la libboost_python-gcc-d-1_33_1.a libboost_python-gcc-mt-1_33_1.a libboost_python-gcc-mt-d-1_33_1.dll libboost_python-gcc.a I cannot see any .dll.lib or .dll.a I would appricate any comments on this problems. Thanx Ninds

Nindi Singh <nindi73@yahoo.co.uk> writes:
My compile command line is :
g++ -o /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/PythonPapa.dll -shared /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/main.os /cygdrive/c/Build/cygwin/gcc/3. .4/Debug/Intermediate/PythonPapa/StdVector.os -L/cygdrive/c/Build/cygwin/gcc/3.4.4/Debug -L/usr/local/lib -L/lib/python2.4/config -lPapaGateWay -lboost_python-gcc-mt-d-1_33_1 -lpython2.4 -lPapaGa eWay
Then there are ALOT of errors
Did you follow the advice here? http://www.boost.org/libs/python/doc/tutorial/doc/html/python/hello.html -- Dave Abrahams Boost Consulting www.boost-consulting.com

Firstly .. I apologise for posting my original mail here , I think I should have emailed to the Python list. As for following the advice at http://www.boost.org/libs/python/doc/tutorial/doc/html/python/hello.html ..err no ... I did not I'm afraid, but on the other hand I am using scons as my underlying build system. However I did manage to solve my problem, be it not in the most elegant way. Under Cygwin I built my Boost Python libraries with the line : bjam --with--python which gave me two boost_python libraries in /usr/local/lib (as well as others) libboost_python-gcc-mt-d-1_33_1.a libboost_python-gcc-mt-d-1_33_1.dll When I was compiling with the g++ command below line I was getting my errors. BUT when I renamed libboost_python-gcc-mt-d-1_33_1.a to libboost_python-gcc-mt-d-1_33_1.axx ( at this point I did not want to actualy delete the static library) the compilation was successful. So I can only conclude that by default I was linking to the static library, and there was something wrong with the doing that. Since I only ever wanted to link to the dll anyway ..... this solution suffices. N ----- Original Message ---- From: David Abrahams <dave@boost-consulting.com> To: boost-users@lists.boost.org Sent: Friday, 14 July, 2006 4:47:20 PM Subject: Re: [Boost-users] Boost Python not linking uder Cygwin Nindi Singh <nindi73@yahoo.co.uk> writes:
My compile command line is :
g++ -o /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/PythonPapa.dll -shared /cygdrive/c/Build/cygwin/gcc/3.4.4/Debug/Intermediate/PythonPapa/main.os /cygdrive/c/Build/cygwin/gcc/3. .4/Debug/Intermediate/PythonPapa/StdVector.os -L/cygdrive/c/Build/cygwin/gcc/3.4.4/Debug -L/usr/local/lib -L/lib/python2.4/config -lPapaGateWay -lboost_python-gcc-mt-d-1_33_1 -lpython2.4 -lPapaGa eWay
Then there are ALOT of errors
Did you follow the advice here? http://www.boost.org/libs/python/doc/tutorial/doc/html/python/hello.html -- Dave Abrahams Boost Consulting www.boost-consulting.com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
David Abrahams
-
Nindi Singh