linking question

M

mdrons

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
 
I

Ian Collins

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.
 
N

NUPUL

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...
 
J

John Tsiombikas (Nuclear / Mindlapse)

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

$>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.
 
N

NUPUL

hey john,

i apologise for the myriad discrepancies you pointed out in the reply.
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
 
V

Vladimir S. Oka

NUPUL opined:
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
 
N

NUPUL

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

Vladimir S. Oka

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."
 
N

NUPUL

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.
 
V

Vladimir S. Oka

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*
 
S

santosh

NUPUL said:
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>
 
D

Default User

NUPUL said:
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
 
C

CBFalconer

NUPUL said:
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/>
 
R

Rod Pemberton

Joe Wright said:
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
 
N

NUPUL

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.....
 
S

santosh

NUPUL said:
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>
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top