g++ can't locate dylib to link at

Discussion in 'C++' started by bowser, Mar 10, 2007.

  1. bowser

    bowser Guest

    Hello,
    I'm using g++ over eclipse in a mac os x. I'm new to all these
    technologies.
    I created a dylib, and to test it I made another project that links to
    it, but the compiler tells me that it can't locate it.
    In my last build I used absolute path to be sure of the location, but
    it still delivers an error.
    The output is:

    **** Build of configuration Debug for project gnawa_tester ****

    make -k all
    Building target: gnawa_tester
    Invoking: MacOS X C++ Linker
    g++ `/Volumes/Quark/c++projects/wxconf-debug` -L/Volumes/Quark/c+
    +projects/gnawax/gnawa_proj/build/Debug -o "gnawa_tester" ./
    SynthetGUI.o ./main.o -llibgnawa_proj
    /usr/bin/ld: can't locate file for: -llibgnawa_proj
    collect2: ld returned 1 exit status
    make: *** [gnawa_tester] Error 1
    make: Target `all' not remade because of errors.
    Build complete for project gnawa_tester

    Any help? I'm stuck here for one day and a half..
    Thank you in advance.
    bowser, Mar 10, 2007
    #1
    1. Advertising

  2. bowser wrote:
    > Hello,
    > I'm using g++ over eclipse in a mac os x. I'm new to all these
    > technologies.
    > I created a dylib, and to test it I made another project that links to
    > it, but the compiler tells me that it can't locate it.
    > In my last build I used absolute path to be sure of the location, but
    > it still delivers an error.
    > The output is:
    >
    > **** Build of configuration Debug for project gnawa_tester ****
    >
    > make -k all
    > Building target: gnawa_tester
    > Invoking: MacOS X C++ Linker
    > g++ `/Volumes/Quark/c++projects/wxconf-debug` -L/Volumes/Quark/c+
    > +projects/gnawax/gnawa_proj/build/Debug -o "gnawa_tester" ./
    > SynthetGUI.o ./main.o -llibgnawa_proj
    > /usr/bin/ld: can't locate file for: -llibgnawa_proj
    > collect2: ld returned 1 exit status
    > make: *** [gnawa_tester] Error 1
    > make: Target `all' not remade because of errors.
    > Build complete for project gnawa_tester
    >
    > Any help? I'm stuck here for one day and a half..
    > Thank you in advance.
    >


    This is a group for C++, not a group about how to use your compiler or
    build environment. You really should ask on a Mac programing group, and
    eclipse group, even a g++ group but not here.

    Now I'm not an expert on any of the things you are doing but if I were
    you I'd try -lgnawa_proj not -llibgnawa_proj, it will only take you two
    minutes to try, who knows it might even work. If it doesn't try a Mac
    programming group. I think they would be best placed to help you.

    john
    John Harrison, Mar 10, 2007
    #2
    1. Advertising

  3. bowser

    bowser Guest

    ok, thanks and sorry for the inconvenience.
    By the way, I've already tried the way you suggested, and also tried
    with and without the extension.
    bowser, Mar 10, 2007
    #3
  4. bowser

    bowser Guest

    Well, no, you were right!
    Even if the library build name starts with "lib", I have to remove
    that prefix in order to link it.
    Before I tried to build it without that prefix.
    Thank you!
    bowser, Mar 10, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    686
    Victor Ng
    Oct 23, 2005
  2. bowser
    Replies:
    1
    Views:
    642
    Victor Bazarov
    Apr 20, 2007
  3. Shane Liesegang

    Dylib or Bundle on OS X?

    Shane Liesegang, Jul 5, 2007, in forum: Ruby
    Replies:
    0
    Views:
    115
    Shane Liesegang
    Jul 5, 2007
  4. Une Bévue
    Replies:
    0
    Views:
    96
    Une Bévue
    Dec 1, 2007
  5. Elias Athanasopoulos

    Load C extension in Mac OS X linked a a dylib

    Elias Athanasopoulos, Dec 1, 2008, in forum: Ruby
    Replies:
    2
    Views:
    91
    Luc Heinrich
    Jan 20, 2009
Loading...

Share This Page