Link errors building against Boost Python
I'm trying to build PyFTGL against 64-bit Python2.7. PyFTGL uses Boost, so I have to build Boost as well (the downloadable installers are all 32-bit). I created a user-config.jam in my home directory with this line: using python : 2.7 : C:\\Python27x64\\python.exe ; and then built Boost's Python libraries with
bjam.exe --toolset=msvc-9.0 --address-model=64 --with-python
PyFTGL uses Python's distutils to build, which doesn't know how to find libraries whose names start with "lib", so I renamed the .lib files in the stage/lib directory: "libboost_python-vc90-mt-1_46_1.lib" to "boost_python-vc90-mt-1_46_1.lib" and so on. Then I tried to build PyFTGL with this:
C:\Python27x64\python.exe setup.py build
I get 41 link errors. Here's the first: ftgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: __cdecl boost::python::detail::tuple_base::tuple_base(struct boost::python::detail::new_reference_t *)" (__imp_??0tuple_base@detail @python@boost@@IEAA@PEAUnew_reference_t@123@@Z) referenced in function "public: __cdecl boost::python::tuple::tuple(struct boost::python::detail::new_reference_t *)" (??0tuple@python@boost@ @QEAA@PEAUnew_reference_t@detail@12@@Z) I've put the entire output up on a pastebin here: http://pastebin.com/iuPzKdKs Any ideas what's going wrong here? Thanks for any suggestions! -Chris
On Thu, May 12, 2011 at 9:30 AM, Chris Weisiger
I'm trying to build PyFTGL against 64-bit Python2.7. PyFTGL uses Boost, so I have to build Boost as well (the downloadable installers are all 32-bit). <snip>
Guess nobody has any ideas for this, then. Any suggestions on where else I could ask for help? -Chris
Hi Chris,
On 16 May 2011 17:13, Chris Weisiger
On Thu, May 12, 2011 at 9:30 AM, Chris Weisiger
wrote: I'm trying to build PyFTGL against 64-bit Python2.7. PyFTGL uses Boost, so I have to build Boost as well (the downloadable installers are all 32-bit). <snip>
Guess nobody has any ideas for this, then. Any suggestions on where else I could ask for help?
Well... there is a boost users mailing list - see http://www.boost.org/community/groups.html#users (I lurk there just to get a feel for things). Also, you can get paid for support from http://www.boostpro.com/ (haven't tried this myself) HTH, Ian -- -- ACCU - Professionalism in programming - http://www.accu.org/
Hi Chris, seems everybody is busy at BoostCon. On Thursday, 12. May 2011 18:30:00 Chris Weisiger wrote:
and then built Boost's Python libraries with
bjam.exe --toolset=msvc-9.0 --address-model=64 --with-python
PyFTGL uses Python's distutils to build, which doesn't know how to find
This should read: bjam.exe toolset=msvc-9.0 address-model=64 --with-python Boost.Build options don't have "--". The generated path names should contain "address-model-64". libraries whose names start with "lib", so I renamed the .lib files in the stage/lib directory: "libboost_python-vc90-mt-1_46_1.lib" to "boost_python- vc90-mt-1_46_1.lib" and so on. This is wrong. Files starting with "lib" are static libraries. See the docs at http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html especially http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html#or- build-binaries-from-source on how to get shared/all library variants.
Then I tried to build PyFTGL with this:
C:\Python27x64\python.exe setup.py build
I get 41 link errors. Here's the first:
ftgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: __cdecl boost::python::detail::tuple_base::tuple_base(struct boost::python::detail::new_reference_t *)" (__imp_??0tuple_base@detail@python@boost@@IEAA@PEAUnew_reference_t@123@@Z) referenced in function "public: __cdecl boost::python::tuple::tuple(struct boost::python::detail::new_reference_t *)" (??0tuple@python@boost@@QEAA@PEAUnew_reference_t@detail@12@@Z)
I've put the entire output up on a pastebin here: http://pastebin.com/iuPzKdKs
And the setup py complain about not finding the shared libs ("__declspec(dllimport))") is a sure sign of this
Any ideas what's going wrong here? Thanks for any suggestions!
Hope this helps. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
Thanks Jürgen! That is helpful. More inline.
On Mon, May 16, 2011 at 11:15 PM, Jürgen Hunold
Hi Chris,
On Thursday, 12. May 2011 18:30:00 Chris Weisiger wrote:
and then built Boost's Python libraries with
bjam.exe --toolset=msvc-9.0 --address-model=64 --with-python
This should read:
bjam.exe toolset=msvc-9.0 address-model=64 --with-python
Boost.Build options don't have "--".
I think what happened here is that at one point I typo'd "address-space" instead of "address-model", got a complaint about not recognizing the option, which went away when I added the --. Of course that's just because at that point it was ignored entirely. Whoops.
The generated path names should contain "address-model-64".
If you're talking about the intermediary build files, then yes, I have e.g. a directory bin.v2/libs/python/build/msvc-9.0/release/address-model-64.
PyFTGL uses Python's distutils to build, which doesn't know how to find libraries whose names start with "lib", so I renamed the .lib files in the stage/lib directory: "libboost_python-vc90-mt-1_46_1.lib" to "boost_python- vc90-mt-1_46_1.lib" and so on.
This is wrong. Files starting with "lib" are static libraries. See the docs at http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html especially http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html#or- build-binaries-from-source on how to get shared/all library variants.
It's been awhile since I spent any significant amount of time wrestling with compiling and linking stuff, so assuming I ever knew that, I clearly forgot. Thanks for the correction. Reading over that documentation, looks like what I wanted was --build-type=complete. That got me boost_python-vc90-mt-1_46_1.lib, which is what PyFTGL was looking for. So that's progress! Unfortunately now PyFTGL is getting a link error looking for boost::throw_exception: http://pastebin.com/DTUX2w84 Am I perhaps missing some "central" Boost library? Except in that case I'd expect to get a complaint that a .lib file wasn't found. I've only built the Python libraries so far; building everything takes a long time. Progress is made, but there's still something missing... -Chris
Hi Chris, On Tuesday, 17. May 2011 18:34:41 Chris Weisiger wrote:
Thanks Jürgen! That is helpful. More inline.
Unfortunately now PyFTGL is getting a link error looking for boost::throw_exception: http://pastebin.com/DTUX2w84
A hint would be:
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Am I perhaps missing some "central" Boost library? Except in that case I'd expect to get a complaint that a .lib file wasn't found. I've only built the Python libraries so far; building everything takes a long time.
You are building without exceptions, so you must provide an implementation of the "exception fallback" "boost::throw_exception". Google and the Boost docs should help to get further information. Just enable exception support.
Progress is made, but there's still something missing...
As always ;-)) Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
On Wed, May 18, 2011 at 10:21 AM, Jürgen Hunold
Hi Chris,
On Tuesday, 17. May 2011 18:34:41 Chris Weisiger wrote:
Thanks Jürgen! That is helpful. More inline.
Unfortunately now PyFTGL is getting a link error looking for boost::throw_exception: http://pastebin.com/DTUX2w84
A hint would be:
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Well now I'm embarrassed. Read the warning messages, Chris! (Of course, so many of the projects I build from source spout so many spurious warning messages that it can be hard to know what to ignore sometimes...) Anyway, that was the last clue I needed; it builds now! Any more problems are my own. :) Thanks again! -Chris
participants (3)
-
Chris Weisiger
-
Ian Bruntlett
-
Jürgen Hunold