libtool
[Top][All Lists]
Advanced

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

Multiply defined _init()


From: michael pruett
Subject: Multiply defined _init()
Date: Thu, 14 Dec 2000 05:38:45 -0500 (EST)

I'm writing a library which has an _init() function.  For reference I
am using Linux; Linux's dlopen calls _init before it finishes.

Here's how I usually compile the shared library.

% gcc -shared -fpic -c funny.c
% ld -shared funny.o -o funny.so -ldl -lm

When I try to use libtool, I run into the following:

% make
/bin/sh ../../../libtool --mode=link gcc -g -O2 -version-info 0:0:0 -release 
1.0 -nostdlib -o libfunny.la funny.lo joke.lo laugh.lo  -ldl -lm
rm -fr .libs/libfunny.la .libs/libfunny.* .libs/libfunny-1.0.*
gcc -shared funny.lo joke.lo laugh.lo -ldl -lm -lc  -Wl,-soname 
-Wl,libfunny-1.0.so.0 -o .libs/libfunny-1.0.so.0.0.0
dmgenesis.lo: In function `_init':
funny.c:56: multiple definition of `_init'
/usr/lib/crti.o(.init+0x0): first defined here
collect2: ld returned 1 exit status

I know this question has been asked before on this mailing list.  I have
searched the archives and found no mention of solutions.  I would greatly
appreciate any help with this matter.

Thanks,
Michael




reply via email to

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