multiple .a files linking issues
RobinK
RobinQi@yahoo.com
Fri Dec 11 14:59:00 GMT 2009
Apologize first if this has already been asked before.
Here is my issue: I have two libraries, libA and libB, in libB there is a
class inherit from a class in libA and calls one of A's member function. so
like this:
In A.h:
class A{
public:
void func1() ;
}
In A.cpp:
void A::func1(){
...
}
In libB:
B.h:
class B : public A{
public:
void func2() ;
}
B.cpp:
void B::func2(){
func1() ;
...
}
I found I have trouble linking these two libraries together with my final
binary. If I link my binary against libA.o and libB.o everything works fine,
but if I do something like this:
g++ /mylib/libA.a /mylib/libB.a myapp.o -o myapp
It would complain:
/mylib/libB.a undifined reference to func1()
Is this to be expected? That I am supposed to use .o file instead of .a
file?
Thanks!
--
View this message in context: http://old.nabble.com/multiple-.a-files-linking-issues-tp26745612p26745612.html
Sent from the gcc - Help mailing list archive at Nabble.com.
More information about the Gcc-help
mailing list