egcs 2.91.57 installed, but...
Kurt Garloff
garloff@hft.e-technik.uni-dortmund.de
Mon Sep 14 14:04:00 GMT 1998
On Sat, Sep 12, 1998 at 07:19:45AM +0000, Lin Zhe Min wrote:
> #include <stdio.h>
> main() { puts("Hello world."); }
> are statically linked so that are huge in space. And trying adding
> -shared in compilation, a larger binary is generated with segmentation
> error in execusion.
-shared is meant to built shared libraries, not binaries linked to shared
libs. You need to use -fPIC while compiling and -shared for linking a shared
lib. If you use -shared on a to link a binary it will segfault.
Make sure you have a .so file, e.g. libfoo.so->libfoo.so.6->libfoo.so.6.1.2
(symlinks) and link with -L/path/to/lib -lfoo in order to get a binary
linked to a shared lib.
--
+--------------------------------------------------------------+
| cand.phys. Kurt Garloff C1-O4-101 (Chemiegeb"aude) |
|Lehrstuhl Hochfrequenztechnik (Fakult"at f"ur Elektrotechnik)|
| Universit"at Dortmund D - 44221 Dortmund |
| Tel.: (0231) 755-3947 Fax: (0231) 755-4631 |
| garloff@hft.e-technik.uni-dortmund.de |
| Public PGP key available ! |
+--------------------------------------------------------------+
More information about the Gcc
mailing list