Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8620733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:39:02+00:00 2026-06-12T06:39:02+00:00

I’ve created a wrapper for my application using boost::python. This has worked so far

  • 0

I’ve created a wrapper for my application using boost::python.

This has worked so far by:
(number of static libraries/source code) -> python_mapping.so

In this way my shared object is comprised of many static libs, including boost itself (notably boost_thread). I would assume that this so would contain ALL my application information, as I’ve statically linked everything in.

This compiles just fine.

ldd python_mapping.so
        librt.so.1 => /lib64/librt.so.1 (0x00002b7cbad37000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002b7cbaf40000)
        libm.so.6 => /lib64/libm.so.6 (0x00002b7cbb240000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b7cbb4c4000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b7cbb6d2000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b7cbb8ed000)
        /lib64/ld-linux-x86-64.so.2 (0x000000327ee00000)

However, when I run my example python application I get this run time linking error:
undefined symbol: _ZTIN5boost6detail16thread_data_baseE

It seems that those boost libraries that linked in fine to the static library aren’t actually there?

I made some progress on this. Apparently my shared object doesn’t include a lot of symbols the compiler didn’t think were being used (because it never saw my c++ objects ever being created, since the are created by instantiating Python Objects).

Kind of like:

//This is a class only created in python
#include "CPlusPlusClass.h"

PythonClass
{
       public:
           PythonClass() { }
       private:
           CPlusPlusClass _cplusplus;
};

//PythonMappings for PythonClass

#python file
import python_mapping

pythonClass = python_mapping.PythonClass() #This fails saying it can't find the symbol for CPlusPlusClass

Compiler will optimize out the CPlusCPlus class out because it never sees it actually being used, which is totally obnoxious. It does seem to keep the PythonClass itself (probably because of the Python Boost Mapping Macro.

You can get around that a few ways:

  1. Link all your libraries with: -Xlinker --whole-archive
  2. Create dummy uses of the libraries in your shared object

I was wondering if anyone can think of another solution, because it is really annoying to go through all the possible libraries and add them in with –whole-archive .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:39:03+00:00Added an answer on June 12, 2026 at 6:39 am

    OK, since no one has responded, I’ve found the easiest (and only solution I know of) is to include EVERY static library you have as:

    -Xlinker --whole-archive
    

    You can, of course, link your libraries dynamically, which will require you to set LD_LIBRARY_PATH when executing your python application (though this wasn’t an option for me for many libraries).

    So, in this sense, explicit dynamic linking might be considered a more elegant solution.

    Beyond that, if your libraries use other libraries:

    python_mapping.so -> static linked in utility1.a -> static linked in utility2.a

    If you’ve forgotten to link in utility1.a running the python application will let you know it can’t find the symbols, however, it will NOT complain about utility2.a, and will have weird behavior when it reaches that part of the library. So… be careful and make sure you’ve explicitly linked in EVERYTHING.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.