Thread: How do I compile a dll/shared library with undefined references?

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    2

    Question How do I compile a dll/shared library with undefined references?

    Hi. I'm new to C (was using C++) and dynamically linked libraries. I'm a self-taught programmer, so if I get any of the terms wrong, so if I'm asking a question which is unbelievably simple to you, please forgive me.


    I want to create a shared library which call code defined in another shared library, but I don't want to link them together at link-time.

    According to this document (http://www.samspublishing.com/articl...p?p=22435&rl=1 -- 2nd paragraph from bottom), I can have a foo() function in DLL_1 which calls bar() in DLL_2, without linking them explicitly, by dlopen-ing them in my main() program using the RTLD_GLOBAL argument. However, I can't figure out how to compile DLL_1, since it contains an undefined reference to bar().

    I've tried all the compiler/linker flags I could find (--undefined-symbol=ignore-all, --allow-shlib-undefined, etc), and I've searched the forum for answers, but I'm still stuck. Does anyone have any pointers? I'm using GCC (Cygwin).
    Last edited by TJay; 06-22-2005 at 11:33 AM.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    2
    Never mind. I think I know what I'm doing wrong. Silly me...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Library troubles with makefile
    By mslate in forum Linux Programming
    Replies: 17
    Last Post: 07-23-2009, 04:43 PM
  2. problem creating .so
    By k0k33 in forum C Programming
    Replies: 7
    Last Post: 04-27-2009, 04:41 AM
  3. Replies: 4
    Last Post: 11-12-2002, 06:26 AM
  4. qt help
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 04-20-2002, 09:51 AM
  5. whats wrong with this
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 02-07-2002, 03:40 PM