static libary ok, dynamic not ok, multiple definiton error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
have some c++ files which I would like to compile to shared library.
I use the command
g++ -shared libmylibrary.so file1.o file2.o ....

I can create the library, but when I try to compile with the user program
lp.cpp I get a problem:

g++ lp.cpp -L. -lmylibrary

I get at lot of "mulitple definition" errors on symbols like init_ fp_hw
and many others.

If I try to make a static library using
ar cru libmylibrary.a file1.o file2.o ....
rans libmylibrary.a

and then compile the main program there are no errors.

Can somebody help me out ?
Best regards,
IB


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux