This is the mail archive of the gcc@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]

Re: egcs 2.91.57 installed, but...


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 !                   | 
+--------------------------------------------------------------+


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