> but when it gets to src/modules, it bombs... Has anyone
> encountered these 'multiply defined' errors, and figured
> out a way around them?

I had something similar the other day.  Fundamentally it's a simple problem,
but I know from my teaching days that people find this aspect of compilation
a bit mysterious, so I'll go into grim detail.

The error is happening at the link stage of compilation.  The makefile has
called gcc over and over to compile all the bits of C and produced object
code and libraries.  Now it calls gcc again to put the bits together to
produce the executable program httpd.

The arguments to the linker are shown on the gcc call below.  It's found a
symbol (a global variable or function name) in the library
/usr/local/lib/libssl.a which it has already seen.  The symbol is called
SSL_SESSION_get_time.  A library is an archived collection of object code
files and it was scanning the object code file ssl_sess.o when it came
across this symbol for the second time.  It doesn't know which one to use.

A couple of possibilities:  the symbol might be defined in another bit of
object code or library that the linker has already scanned OR the object
code file ssl_sess.o has been put into the library twice.

The problem is almost certainly to do with the way you have configured the
build (using the configure script).  In my case, the config builder script
had screwed up and put an object code file into the list twice - my gcc link
command was effectively:

        gcc foo.o foo.o -o thing

so it saw every symbol in foo.o twice.

My version of gcc produced a more helpful message, saying that a symbol in
foo.o was multiply defined, previously defined in foo.o.  If the thing would
tell you where it saw the symbol before, that would help you a lot.  Are you
using the latest version of gcc?

I notice that the list below contains "modules/ssl/libssl.a" and then
"-lssl".  The second expands into "scan the library libssl.a".  Is this the
problem?

A quick and dirty way to find out is to cut and paste the gcc command, fix
it by removing one of the references to the library, issue it manually and
see if the error goes away.  If it does, start looking at your configuration
to see why the problem occurs.


Simon


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Peter Losher
> Sent: 12 December 2001 01:54
> To: [EMAIL PROTECTED]
> Subject: 'multiply defined' errors in compile...
>
>
>
> I am trying to compile Apache v1.3.22 (w/ mod_ssl, PHP4 and
> mod_auth_krb5) on a DEC True64 v5.0 system, and most of the compile goes
> along smoothly, but when it gets to src/modules, it bombs...
>
> -=-
> <=== src/modules
> [...]
> gcc  -DOSF1 -DMOD_SSL=208105 -I/home/plosher/httpd/php-4.1.0
> -I/home/pl/httpd/php-4.1.0/main -I/home/pl/httpd/php-4.1.0/main
> -I/home/pl/httpd/php-4.1.0/Zend -I/home/pl/httpd/php-4.1.0/Zend
> -I/home/pl/httpd/php-4.1.0/TSRM -I/home/pl/httpd/php-4.1.0/TSRM
> -I/home/pl/httpd/php-4.1.0 -DEAPI -DUSE_EXPAT -I./lib/expat-lite
> -DKRB5 -DKRB_DEF_REALM=\"DEFAULT\" `./apaci` -L/usr/local/lib    -o httpd
> buildmark.o modules.o  modules/ssl/libssl.a  modules/extra/libextra.a
> modules/php4/libphp4.a  modules/standard/libstandard.a  main/libmain.a
> ./os/unix/libos.a  ap/libap.a  lib/expat-lite/libexpat.a
> -L/usr/local/krb5/lib -lkrb5 /usr/local/krb5/lib/libk5crypto.a -lcom_err
> -Wl,-rpath,/usr/local/pgsql/lib  -L/usr/local/pgsql/lib -Lmodules/php4
> -L../modules/php4 -L../../modules/php4 -lmodphp4   -lpq -lresolv -lm
> -lresolv   -lm  -ldbm -lssl -lcrypto -lm
> /usr/bin/ld:
> /usr/local/lib/libssl.a(ssl_sess.o): SSL_SESSION_get_time:
> multiply defined
> /usr/local/lib/libssl.a(ssl_sess.o): SSL_SESSION_set_timeout:
> multiply defined
> /usr/local/lib/libssl.a(ssl_sess.o): SSL_SESSION_free: multiply defined
> /usr/local/lib/libssl.a(ssl_sess.o): SSL_get_session: multiply defined
> /usr/local/lib/libssl.a(ssl_lib.o): SSL_CTX_set_cipher_list:
> multiply defined
> /usr/local/lib/libssl.a(ssl_lib.o): SSL_CTX_new: multiply defined
> /usr/local/lib/libssl.a(ssl_lib.o): SSL_CTX_free: multiply defined
> /usr/local/lib/libssl.a(ssl_lib.o): SSL_CTX_get_cert_store:
> multiply defined
> /usr/local/lib/libssl.a(ssl_lib.o): SSL_clear: multiply defined
> /usr/local/lib/libssl.a(ssl_lib.o): SSL_get_current_cipher:
> multiply defined
> [...]
> collect2: ld returned 1 exit status
> *** Exit 1
> Stop.
> *** Exit 1
> Stop.
> *** Exit 1
> Stop.
> -=-
>
> Has anyone encountered these 'multiply defined' errors, and figured out a
> way around them?
>
> Thanks - Peter Losher
> --
> [EMAIL PROTECTED] - Internet Software Consortium - http://www.isc.org/
>
>
> ______________________________________________________________________
> Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
> User Support Mailing List                      [EMAIL PROTECTED]
> Automated List Manager                            [EMAIL PROTECTED]
>

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to