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

  • SEARCH
  • Home
  • 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 8476969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:19:31+00:00 2026-06-10T18:19:31+00:00

I am a C noob, so this may be a stupid question. I am

  • 0

I am a C noob, so this may be a stupid question. I am trying to compile a .so file (shared library, if I have my terminology correct) of C objects (.o files), for the express purpose of importing them into Python via ctypes. I first compiled the *.so with

gcc -shared -o libvARAM.so ARAM.o ARAM_io.o io.o pre.o rule.o stat.o ART.o vARAM.o

This worked, except that when I tried loading via ctypes I was rewarded with:

OSError: ./libvARAM.so: undefined symbol: max

After some digging, I realized that max is not a standard C function. Calling ldd libvARAM.so informed me that one of the dependencies is libc.so.6. I created a symlink libc.so to libc.so.6 and then tried recompiling my .so as

gcc -shared -o libvARAM.so ARAM.o ARAM_io.o io.o pre.o rule.o stat.o ART.o vARAM.o -llibc

which generated

/usr/bin/ld: cannot find -llibc

The same error is generated if I also try -L/lib/i386-linux-gnu/ -llibc. I am aware of this thread, but feel it is not relevant to my situation, as the solution there is for a makefile. I am using Xubuntu if this matters.

Any help is sincerely appreciated!

  • 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-10T18:19:33+00:00Added an answer on June 10, 2026 at 6:19 pm

    One: Linker flags don’t work like that. For libXYZ.so, the corresponding linker flag is NOT -llibXYZ but only -lXYZ.

    Two: even this is not needed, as the C standard library (-lc) is automatically linked to the executable.

    Three: your problem most likely is that there should be a max() macro (as opposed to a function) defined in one of the header files, but you don’t include this header file, so the compiler doesn’t know it’s a macro and treats it as a function – thenof course it can’t find it in libc.so because it’s not there.

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

Sidebar

Related Questions

This may sound like a noob question, because it is. I have tried for
Hi Sorry for this noob question but here goes...i have a working slidetoggle on
I am an IOS noob and this may be a dumb question, so here
It may be a noob question but is this something to do with my
Ok this may seem like a bit of a noob question but one many
This may be a noob question but I want to hide the content within
This is may be a noob question, but I was wondering why do we
It may be a noob question but I have some doubt. I googled a
I know this may be a noob question, but it's bugging the heck out
I know this may be stupid question i am gonna put here since i

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.