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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:50:44+00:00 2026-05-11T12:50:44+00:00

I have a shim library (shared, C++) which calls functions in another shared library

  • 0

I have a shim library (shared, C++) which calls functions in another shared library (libexif) and presents a simple interface to C# for Platform Invoke calls. (That is, a C# program uses PInvoke to call my custom shared library which in turn calls another shared library.)

In Windows, my custom shared library links to the shared library when my custom library links and when the C# application executes, all symbols are resolved.

On Linux, linking my shared library does not link the other shared library. With a C++ driver, I specify the other library when the application is linked and at that time, all symbols are resolved. However, when I try to call my shared library from a C# program (compiled using mono) symbols in the other shared library are not resolved. I’ve tried using the MONO_PATH variable to specify the other library but it seems not to make a difference. I’ve also tried specifying the unresolved function in a DLLimport statement, but that seems not to help either.

How can I specify a shared library that is not directly called by C# code so that mono/cli finds it at run time?

I use the following commands to build the shared library:

g++ -fPIC -g -c -Wall  libexif-wrapper.cpp g++ -shared -Wl,-soname,libexif-wrapper.so.1     -o libexif-wrapper.so.1.0.1 libexif-wrapper.o -lc ar rcs libexif-wrapper.a libexif-wrapper.so.1 

And the following command line to compile my C# driver:

mcs -unsafe -define:LINUX Test-libexif-wrapper.cs 

On execution I get an error that a symbol used by my shared library is not found:

/usr/bin/cli: symbol lookup error: ../../../C/libexif-wrapper/libexif-wrapper/libexif-wrapper.so.1: undefined symbol: exif_data_new_from_file 

(libexif-wrapper is my shared library which serves as a shim between the C# application and libexif.)

I have not been able to figure out how to solve this. Any suggestions would be appreciated.

edit: To answer the question:

Are you sure that the unmanaged libexif-wrapper can be found in the LD_LIBRARY_PATH environment variable?

In fact it is not. I have crafted the path in the DLLImport to point directly to it instead. The run time finds it because it reports the path to it in the error message above. Further the missing symbol is not called by the C# program but rather one of the functions in my shared library calls the function that is then not found. (thanks – hank)

  • 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. 2026-05-11T12:50:44+00:00Added an answer on May 11, 2026 at 12:50 pm

    You should specify the dependency when you link the wrapper library like

    g++ -shared -Wl,-soname,libexif-wrapper.so.1 -o libexif-wrapper.so.1.0.1 libexif-wrapper.o -lc -lexif 

    When you do that the dynamic linker knows that libexif-wrapper depends on libexif and it can resolve the symbols on load.

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

Sidebar

Ask A Question

Stats

  • Questions 116k
  • Answers 116k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For the reading confirmations: You have to add the X-Confirm-Reading-To… May 11, 2026 at 10:31 pm
  • Editorial Team
    Editorial Team added an answer Yes. But: This is a large structure, and declaring it… May 11, 2026 at 10:31 pm
  • Editorial Team
    Editorial Team added an answer A case where regular expressions are justified: import re DATA… May 11, 2026 at 10:31 pm

Related Questions

I have created an automation addin in C# .NET and have a shim dll
I have a web page which contains a select box. When I open a
There is very strange assembly reference problem and loading problem I experience with my
I ahve a menu structure that uses UL and LI elements to drop down

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.