help-gplusplus
[Top][All Lists]
Advanced

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

Doubt about -fpic option for compiling objects of shared library


From: kiran
Subject: Doubt about -fpic option for compiling objects of shared library
Date: 4 Oct 2005 05:25:04 -0700
User-agent: G2/0.2

Hi,
I am using gcc 2.95.3, and have to continue with this :-(

According to docs, there are 2 steps:
1> the object files must be compiled using -fpic
2> Shared library is created using -shared -fpic

Now my doubt is,
even if I do not use -fpic option of the first step above, it still
works (on linux and solaris)!!!
i.e. I compiled the object files using only '-c' option and built the
.so using -shared and -fpic.
So is -fpic really required in the first step above???

On the contrary,
on Xeon(Sun-fire V65X) machine, when I use -fpic in the first step
above, application crashes for "throw" statement.
And if I do not use -fpic in first step, application does not crash!
I am also linking STLPort (ver 4.5.3)and QT(QT-3.3.1) libraries to my
application. These libraries were compiled on Pentium-4 machine.

Thanks and best regards,
- Kiran



reply via email to

[Prev in Thread] Current Thread [Next in Thread]