[Top][All Lists]

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

Newbie help regarding .so modules

From: Michael Reynolds
Subject: Newbie help regarding .so modules
Date: Fri, 21 Feb 2003 22:11:08 -0800 (PST)

I have 2 modules, each with their own _init and _fini functions.  My file is as follows:
dns_la_SOURCES = dns.c
dns_la_LDFLAGS = -module $(LDFLAGS)
select_la_SOURCES = select.c
select_la_LDFLAGS = -module $(LDFLAGS)

After running automake, autoconf, etc, I try to compile, and I receive
this, minus start/end wrappers:

****************** START ******************
/bin/bash ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I../../include      -g -O2 -c -o dns.lo `test -f 'dns.c' || echo
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -g -O2 -c dns.c  -fPIC
-DPIC -o .libs/dns.lo
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -g -O2 -c dns.c -o dns.o
>/dev/null 2>&1
mv -f .libs/dns.lo dns.lo
/bin/bash ../../libtool --mode=link gcc  -g -O2    -o -rpath
/usr/local/lib -module  dns.lo  
rm -fr .libs/ .libs/dns.* .libs/dns.*
gcc -shared  dns.lo   -Wl,-soname -Wl, -o .libs/
dns.lo: In function `_init':
/services/services/src/modules/dns.c:40: multiple definition of `_init'
/usr/lib/crti.o(.init+0x0): first defined here
dns.lo: In function `_fini':
/services/services/src/modules/dns.c(.text+0x88): multiple definition
of `_fini'
/usr/lib/crti.o(.fini+0x0): first defined here
*** Error code 1
****************** END ******************

What I need help with is compiling the so modules.  I have no idea what
crti.o is.  I've no trouble compiling when doing so manually, but I
compile without linking, and call ld separately.  I would rather use
the automake suite, however, than writing the entire Makefiles on my
own.  Thanks in advance for any help provided.

Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more

reply via email to

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