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 9133017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:24:46+00:00 2026-06-17T08:24:46+00:00

I’m compiling an executable called interrogate with: g++ -o built/bin/interrogate -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib \

  • 0

I’m compiling an executable called “interrogate” with:

g++ -o built/bin/interrogate -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib \
built/tmp/interrogate_composite1.o built/tmp/interrogate_composite2.o \
-lp3cppParser -lp3dtool -lp3dtoolconfig -lp3pystub -pthread -ldl

After the compilation, when i try to execute the executable:

$ LD_LIBRARY_PATH=built/lib built/bin/interrogate
built/bin/interrogate: symbol lookup error: built/lib/libp3dtool.so.1.8: undefined symbol: _Py_NoneStruct

This symbol is provided by the libp3pystub.so, but the interrogate executable doesn’t have any reference to this library (I did used the -lp3pystub):

$ LD_LIBRARY_PATH=built/lib ldd built/bin/interrogate
    linux-vdso.so.1 =>  (0x00007fff2016a000)
    libp3dtool.so.1.8 => built/lib/libp3dtool.so.1.8 (0x00007f498d57a000)
    libp3dtoolconfig.so.1.8 => built/lib/libp3dtoolconfig.so.1.8 (0x00007f498d51b000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f498d1f2000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f498cfdc000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f498cdbf000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f498c9ff000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f498c7fb000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f498c4ff000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f498d5bc000)

If i manually load the libp3pystub.so, the executable works:

$ LD_PRELOAD=built/lib/libp3pystub.so LD_LIBRARY_PATH=built/lib built/bin/interrogate

Usage:
  interrogate [opts] file.C [file.C ...]
  interrogate -h

My question is: why the library i’ve added with -lp3pystub is not referenced by the interrogate executable?

  • 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-17T08:24:48+00:00Added an answer on June 17, 2026 at 8:24 am

    I actually find the answer myself. I was compiling on Ubuntu, and they added a default optimization flags: -Wl,--as-needed. This optimization check if no symbol from the libraries passed with -l are used in the main executable, they will be removed.

    And that’s where my error was: _Py_NoneStruct is not directly used by interrogate, but by another shared library. So i must manually specify that the p3pystub is needed.

    One possible fix would be:

    $ g++ -o built/bin/interrogate -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib \
    built/tmp/interrogate_composite1.o built/tmp/interrogate_composite2.o \
    -Wl,--no-as-needed -lp3cppParser -lp3dtool -lp3dtoolconfig -lp3pystub \
    -pthread -ldl
    

    And then i correctly got the library in the ldd output:

    $ LD_LIBRARY_PATH=built/lib ldd built/bin/interrogate
        linux-vdso.so.1 =>  (0x00007fff0edff000)
        libp3dtool.so.1.8 => built/lib/libp3dtool.so.1.8 (0x00007fa1c36be000)
        libp3dtoolconfig.so.1.8 => built/lib/libp3dtoolconfig.so.1.8 (0x00007fa1c365f000)
    >>> libp3pystub.so.1.8 => built/lib/libp3pystub.so.1.8 (0x00007fa1c3658000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa1c342f000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa1c312c000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa1c2e2f000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa1c2c19000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa1c29fc000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa1c263c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fa1c3700000)
    

    Reference:
    https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am confused How to use looping for Json response Array in another Array.

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.