linking question

Discussion in 'C Programming' started by mdrons@yahoo.com, Mar 17, 2006.

  1. Guest

    I am trying to create a library and I am getting a linking error.

    I have a library mylib.so. mylib.so uses mysqlclient. When I compile
    my .o files and then try to link them using mylib.so, i get an error
    saying that mysql_init (part of mysqlclient) is unknown.

    Any help on what I am missing?

    Mike
     
    , Mar 17, 2006
    #1
    1. Advertising

  2. Ian Collins Guest

    wrote:
    > I am trying to create a library and I am getting a linking error.
    >
    > I have a library mylib.so. mylib.so uses mysqlclient. When I compile
    > my .o files and then try to link them using mylib.so, i get an error
    > saying that mysql_init (part of mysqlclient) is unknown.
    >
    > Any help on what I am missing?
    >

    OT here, try comp.unix.programmer.

    Hint - you have to specify all object files and libraries to the linker.

    --
    Ian Collins.
     
    Ian Collins, Mar 18, 2006
    #2
    1. Advertising

  3. NUPUL Guest

    hey mike...i maybe able to help....

    i faced the same problem at one time...an error too trivial but yet
    over looked...
    on the prompt when you compile your file there a re a few libs you need
    to include, which you may not be doing, i.e

    $>gcc... -lmysqlclient

    or

    $>gcc... -llibmysqlclient

    hope it works...
     
    NUPUL, Mar 18, 2006
    #3
  4. On 2006-03-18, NUPUL <> wrote:
    > i faced the same problem at one time...an error too trivial but yet
    > over looked...


    What problem? Please include context, and proper attribution when you
    reply to an article, so that we may know what are you talking about, and
    who are you talking to.

    > on the prompt when you compile your file there a re a few libs you need
    > to include, which you may not be doing, i.e


    <OT>
    Or even better yet, write a makefile so you don't forget things easily.

    > $>gcc... -lmysqlclient


    correct.

    > $>gcc... -llibmysqlclient


    incorrect, the lib prefix is implied, a different way might be:
    gcc .... $(libdir)/libmysqlclient.a
    given that there is a static library available, note: no -l
    </OP>

    How do you know the OP is using GCC ? Unless I missed it, he didn't
    specify. And even if he did, how to use a specific compiler is not on
    topic in comp.lang.c.

    What you *could* answer in order to be on topic, and not assume anything
    about the OP's tools is that: the OP has probably forgot to link the
    library he mentioned, and he should read the documentation of his C
    implementation to find out how to do that.

    --
    John Tsiombikas (Nuclear / Mindlapse)

    http://nuclear.demoscene.gr/
     
    John Tsiombikas (Nuclear / Mindlapse), Mar 18, 2006
    #4
  5. NUPUL Guest

    hey john,

    i apologise for the myriad discrepancies you pointed out in the reply.

    john wrote:
    >How do you know the OP is using GCC ? Unless I missed it, he didn't
    >specify.


    i presumed 'gcc' on the pretext that mike wanted to link a '.so' file,
    right? so i presumed the presence of gcc.........my apologies to you if
    my presumptions hurted your feelings

    >And even if he did, how to use a specific compiler is not on
    >topic in comp.lang.c.


    I am fully aware that this is a comp.lang.c group and i presume that a
    compiler is a must!!

    Sorry if my presumptions gave you a restless time....i'll take care of
    next time..

    Thanks for pointing it out.

    Nupul
     
    NUPUL, Mar 20, 2006
    #5
  6. NUPUL opined:
    > john wrote:
    >>
    >>And even if he did, how to use a specific compiler is not on
    >>topic in comp.lang.c.

    >
    > I am fully aware that this is a comp.lang.c group and i presume that
    > a compiler is a must!!


    Still off-topic, as c.l.c discusses C language, not tools.

    --
    BR, Vladimir

    We are not loved by our friends for what we are;
    rather, we are loved in spite of what we are.
    -- Victor Hugo
     
    Vladimir S. Oka, Mar 20, 2006
    #6
  7. NUPUL Guest

    vladimir, i had just highlighted a syntax and wasn't keen on discussing
    the tool per se.
     
    NUPUL, Mar 20, 2006
    #7
  8. NUPUL opined:

    > vladimir, i had just highlighted a syntax and wasn't keen on
    > discussing the tool per se.


    Quote context (you were already told this). Read:

    <http://cfaj.freeshell.org/google/>
    <http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

    You were not discussing *C* syntax. You offered a couple of compiler
    invocation lines. How is that not discussing the tool, per se or not,
    is beyond me.

    --
    BR, Vladimir

    A young lad named Lester McGraw
    Caught a stranger on top of his Maw.
    As he watched him stick her
    He said, with a snicker,
    "You do it much faster than Paw."
     
    Vladimir S. Oka, Mar 20, 2006
    #8
  9. NUPUL Guest

    my apologies vladimir, i'll take care next time not to hurt the
    chauvinism of the group members of c.l.c and be confined to *C* in my
    discussion.
     
    NUPUL, Mar 21, 2006
    #9
  10. NUPUL opined:

    > my apologies vladimir, i'll take care next time not to hurt the
    > chauvinism of the group members of c.l.c and be confined to *C* in my
    > discussion.


    You have been asked, nicely, to quote context twice before. You still
    fail to. Now, you also call people names, and try to be facetious.

    Being a c.l.c chauvinist, feelings hurt beyond repair, I must say this:

    *PLONK*

    --
    BR, Vladimir

    There are always alternatives.
    -- Spock, "The Galileo Seven", stardate 2822.3
     
    Vladimir S. Oka, Mar 21, 2006
    #10
  11. santosh Guest

    NUPUL wrote:
    > my apologies vladimir, i'll take care next time not to hurt the
    > chauvinism of the group members of c.l.c and be confined to *C* in my
    > discussion.


    It is not chauvanism. It's a sensible policy to keep the group within
    topic and to prevent it decaying into a free-for-all like so many other
    Usenet groups.

    As an aside, even after being told repeatedly, you've once again failed
    to quote context in your posts. Please make sure to read the following
    if you want to be taken seriously by many of the group's regulars:

    <http://cfaj.freeshell.org/google/>
    <http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>
     
    santosh, Mar 21, 2006
    #11
  12. Default User Guest

    NUPUL wrote:

    > my apologies vladimir, i'll take care next time not to hurt the
    > chauvinism of the group members of c.l.c and be confined to C in my
    > discussion.


    *plonk*



    Brian
     
    Default User, Mar 21, 2006
    #12
  13. CBFalconer Guest

    NUPUL wrote:
    >
    > my apologies vladimir, i'll take care next time not to hurt the
    > chauvinism of the group members of c.l.c and be confined to *C* in my
    > discussion.


    PLONK for refusing to quote adequate context, and being generally
    unpleasant.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
     
    CBFalconer, Mar 21, 2006
    #13
  14. Joe Wright Guest

    CBFalconer wrote:
    > NUPUL wrote:
    >> my apologies vladimir, i'll take care next time not to hurt the
    >> chauvinism of the group members of c.l.c and be confined to *C* in my
    >> discussion.

    >
    > PLONK for refusing to quote adequate context, and being generally
    > unpleasant.
    >

    Careful, "generally unpleasant" is a very broad brush.

    --
    Joe Wright
    "Everything should be made as simple as possible, but not simpler."
    --- Albert Einstein ---
     
    Joe Wright, Mar 22, 2006
    #14
  15. "Joe Wright" <> wrote in message
    news:...
    > CBFalconer wrote:
    > > NUPUL wrote:
    > >> my apologies vladimir, i'll take care next time not to hurt the
    > >> chauvinism of the group members of c.l.c and be confined to *C* in my
    > >> discussion.

    > >
    > > PLONK for refusing to quote adequate context, and being generally
    > > unpleasant.
    > >

    > Careful, "generally unpleasant" is a very broad brush.
    >


    He's going for the world record in PLONK's. He's probably over 300 now...


    Rod Pemberton
     
    Rod Pemberton, Mar 22, 2006
    #15
  16. Jordan Abel Guest

    On 2006-03-22, Rod Pemberton <> wrote:
    >
    > "Joe Wright" <> wrote in message
    > news:...
    >> CBFalconer wrote:
    >> > NUPUL wrote:
    >> >> my apologies vladimir, i'll take care next time not to hurt the
    >> >> chauvinism of the group members of c.l.c and be confined to *C* in my
    >> >> discussion.
    >> >
    >> > PLONK for refusing to quote adequate context, and being generally
    >> > unpleasant.
    >> >

    >> Careful, "generally unpleasant" is a very broad brush.
    >>

    >
    > He's going for the world record in PLONK's. He's probably over 300 now...


    And how many do you have?

    --
    One more, now.
     
    Jordan Abel, Mar 22, 2006
    #16
  17. NUPUL Guest

    well it seems i've got quite a battering....seems fair though, I think
    i do deserve it for the unpleasant response. Well I will SURELY be in
    context next time though. Sorry for the inconvenience to all.

    Well just for the record...ever thought of the person who actually
    started the topic? this discussion took an unusual turn to
    "Nupul-battering" and v.little reference to the context of his query!!!

    Thanks for pointing out the zillion mistakes i made...

    Nupul

    Oh ya...special apologies to vladimir.....
     
    NUPUL, Mar 23, 2006
    #17
  18. santosh Guest

    NUPUL wrote:
    > well it seems i've got quite a battering....seems fair though, I think
    > i do deserve it for the unpleasant response. Well I will SURELY be in
    > context next time though. Sorry for the inconvenience to all.


    You're still not including context in your posts even after several
    reminders by others. You've already been kill-filed by some regulars
    and if you persist in disregarding advice you'll be plonked by the rest
    of the regulars as well. Please read the following and take note:

    <http://cfaj.freeshell.org/google/>
    <http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>
    <http://en.wikipedia.org/wiki/USENET>
    <http://en.wikipedia.org/wiki/Netiquette>
    <http://www.safalra.com/special/googlegroupsreply/>

    > Well just for the record...ever thought of the person who actually
    > started the topic? this discussion took an unusual turn to
    > "Nupul-battering" and v.little reference to the context of his query!!!


    It took a "NUPUL battering" because you consistently failed to include
    context and to stop posting off-topic stuff. You're sarcastic tone also
    doesn't help.


    > Thanks for pointing out the zillion mistakes i made...
    > Nupul
    >
    > Oh ya...special apologies to vladimir.....


    See what I mean? Regardless of who's at fault, you can take the step of
    leaving this thread and heeding the advice given at the above URLs next
    time you post.
     
    santosh, Mar 23, 2006
    #18
    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. John Baker
    Replies:
    3
    Views:
    307
    Kevin Spencer
    Feb 8, 2005
  2. =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=

    Control linking question ????

    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Nov 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    318
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
    Nov 1, 2005
  3. Kirok
    Replies:
    2
    Views:
    351
    Kirok
    Nov 10, 2005
  4. Dylan Parry

    Stylesheet linking question

    Dylan Parry, Nov 15, 2004, in forum: HTML
    Replies:
    6
    Views:
    454
    Davmagic .Com
    Nov 15, 2004
  5. Hugo de Payns

    Linking question

    Hugo de Payns, Jun 22, 2005, in forum: HTML
    Replies:
    1
    Views:
    380
    Toby Inkster
    Jun 23, 2005
Loading...

Share This Page