|
-
July 29th, 2009, 10:34 AM
#1
Multiply defined symbols?
I have some static library libA.a that has symbols x & y defined. I'm building another static library libB.a which seems to also be defining symbols x & y. So when I try to build executable C while linking libA.a and libB.a, I get a multiply defined symbols error. But when I build libB.a linking libA.a, I don't get any errors. Shouldn't I get the same error when I try to build libB.a and link in libA.a?
edit: I always find the problem after I make a post. My make file had an error in it and wasn't linking things properly.
Last edited by homer_3; July 29th, 2009 at 10:43 AM.
-
July 29th, 2009, 10:42 AM
#2
Re: Multiply defined symbols?
Building a library doesn't have a concept of linking, at least not in the same way that executables do.
-
July 29th, 2009, 02:41 PM
#3
Re: Multiply defined symbols?
Those symbols need to be in the #include that you use to interface with the library, not the library itself.
-
July 29th, 2009, 02:46 PM
#4
Re: Multiply defined symbols?
Linker errors have nothing to do with #includes.
Well, except that incorrect header file usage can cause them.
-
July 29th, 2009, 06:21 PM
#5
Re: Multiply defined symbols?
Oops, I misread the post.
-
July 29th, 2009, 11:27 PM
#6
Re: Multiply defined symbols?
Thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|