Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    gcc shared library for g++ application

    I built a shared library for some API functions (C files) and compiled them with gcc. Now I'm writing a c++ application (compiling with g++) and want to link my C API shared library and be able to use it from my application. Is this possible? At first instance, it's not quite working for me. I was able to link my shared lib just fine with a C application but got an "undefined reference to `apiFunction()'" error when attempting to do it with g++. Just want to see if anyone has any insight on this subject and make sure this mix is even is allowed.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Basically, something in either your c++ application, or in the shared library, is trying to call apiFunction(), but it isn't there. This is not a gcc/g++ problem, but an application development error.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts