This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

compiler and linker flags


I have a compile/link problem and would like to figure out what kinds of
flags I need to use to get the code to compile. Here is the problem.

I have lots of code, C++, some will go into shared libraries, some is
used for executables. At compile time however I do not know which .C
file will be part of a shared library and which file will be part of a
shared library. This means I have to compile all code with the same
compiler flags. Currently I am using fPIC when compiling the code. This
works for the shared libraries, i.e. they compile and link. However,
when I try to link executables I get lots of errors, unresolved symbols
mostly. The trick here is that at link time I know which object files
become shared libraries and which ones are to become executables.

Thus what I am looking for is either a way to get executables to link
when the fPIC option was used at compile time, or a way to compile
without fPIC but still make the shared libraries work. At link time I
can do extra tricks if necessary to get the appropriate symbols
exported, I know the symbols I am looking for and in which object code
they are.

Any ideas, help is appreciated.

Thanks,
Robert

--
Robert Schweikert                      MAY THE SOURCE BE WITH YOU
rjschwei@mindspring.com                         LINUX




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]