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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:33:59+00:00 2026-06-05T19:33:59+00:00

I want to use one program as a shared library for an other program.

  • 0

I want to use one program as a shared library for an other program.

I started as follows:
I have a application which I have compiled using:

/usr/bin/g++ -I/usr/include/libxml2  -Xlinker -zmuldefs -fPIC -c a.cpp
/usr/bin/g++ -I/usr/include/libxml2  -Xlinker -zmuldefs -fPIC -c b.cpp
/usr/bin/g++ -I/usr/include/libxml2  -Xlinker -zmuldefs -fPIC -c c.cpp

Then I have created a shared object library from the objects I get from this file using this command:

g++ -fPIC -Xlinker -zmuldefs -shared -o libabc.so a.o b.o c.o

After this I get the libabc.so file which I copy to the

sudo cp libabc.so /usr/local/lib/libabc.so

Now when I compile my orignal application which will use this newly created library libabc.so using this command:

/usr/local/lib/libabd.so: undefined reference to `xmlXPathNewContext'

I get errors for all the functions I used from the included library libxml2 in the first application and the function which has this undefined reference is actually the library I include in the first program I mean I have tested it.
So kindly anyone guide me where I need corrections.

  • 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-05T19:34:00+00:00Added an answer on June 5, 2026 at 7:34 pm

    You may have to pass the path also using -I/path/to/library, or alternatively export it to LD_LIBRARY_PATH.

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

Sidebar

Related Questions

I have a few pages and want that they use one style. See in
I want to use libx264 in one of my projects on windows. I compiled
I'm trying to create a shared library on ubuntu using gcc I just have
I've got a wxWidgets program. For one piece of it, I want to use
I want to use one thread to get fields of packets by using tshark
We are two students who want to use one-class svm for dectection of summary
I'm writing a webpage where I want to use one font for normal text
I want to use Paypal Payment Standard(the one jumps to paypal to pay and
I want to use multiple queries in one list view.In my list view each
I want to use the values of JTextFields from one class in another class

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.