It's hard to get the includes/libs right by hand on the command line. Better to use a build-tool like bjam, cmake, or something. Can you try this cmake build: https://github.com/aewallin/sandbox/tree/master/boost_python_helloworld cmake . and then make
if you want to see the actual command-line cmake produces I think you can see it with make VERBOSE=1. Ubuntu 12.10 has boost 1.49.0 by default, so it looks like you are using a DIY-build of boost? That may be the cause also. Anders On Thu, Dec 20, 2012 at 6:47 AM, Hesam <hesam.ila...@gmail.com> wrote: > Hello, > > I am trying to compile and link boost-python hello world example and I > have some linking problems. > > OS: Ubuntu > > g++ -fPIC -w Test2.cpp -I ../../../Libs/Python/Python-2.7.3/Include -I > ../../../Libs/Python/Python-2.7.3 -I ../../../Libs/Boost/boost_1_52_0 > -Wl,-rpath,../../../Libs/Python/Python-2.7.3/build/lib.linux-x86_64-2.7 -L > -L../../../Libs/Python/Python-2.7.3/build/lib.linux-x86_64-2.7 -lssl -lcrypto > -lpthread -lm -lutil -lpython2.7 -Wl,-rpath, > -L../../../Libs/Boost/boost_1_52_0/lib > -L../../../Libs/Boost/boost_1_52_0/stage/lib -lboost_python > > I get the following *Error* > > ../../../Libs/Boost/boost_1_52_0/stage/lib/libboost_python.so: undefined > reference to `PyUnicodeUCS2_AsWideChar' > ../../../Libs/Boost/boost_1_52_0/stage/lib/libboost_python.so: undefined > reference to `PyUnicodeUCS2_FromEncodedObject' > collect2: ld returned 1 exit status > make: *** [Test2] Error 1 > > I heard that it maybe due to incompatible version of python and the python > library used by Boost-python. But whatever I tried I couldn't solve the > problem. It is taking several days and no success. Appreciate any comment. > > Thanks > > Hesam > > > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig >
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig