I wrote:

> I'm curious to know if anybody else faced the following problem I
> had today when I tried to compile Apache-1.3.9/mod-ssl-2.4.9 by MS
> VC6 under NT4 (I don't know if it has anything to do with mod_ssl):
> ---------------------------------------------------------------------
> D:\eli\apache_1.3.9\src>nmake /f Makefile.nt _apacher
> 
> Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
> Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
> 
> ... etc ...
>
>         link.exe @C:\TEMP\nmb00228.
> MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in 
>LIBC.lib(crt0dat.obj)
> MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fprintf already defined in 
>LIBC.lib(fprintf.obj)
>
> ... etc ...
>
>    Creating library .\CoreR\ApacheCore.lib and object .\CoreR\ApacheCore.exp
> LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use 
>/NODEFAULTLIB:library
> .\CoreR\ApacheCore.dll : fatal error LNK1169: one or more multiply defined symbols 
>found
> NMAKE : fatal error U1077: 'link.exe' : return code '0x491'
> Stop.
> NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~1\VC98\BIN\NMAKE.EXE' : return code 
>'0x2'
> Stop.
> ---------------------------------------------------------------------

I found the answer, and send it to both mailing lists, so the next one
who will search the archives for a similar problem, will find my
original message and this one, and hopefully will overcome the problem
as me:

The cause of the problem was an object file which was compiled without
the "/MD" flag (for multithreading; All the objects which are included
in the link of Apache must be compiled with it, as it seems). I added
the flag and re-compiled that object, and finally succeeded to link
Apache (I used "_apached"). But then, when I tried to run the
executable, it crashed, and the debugger sent me to a strange place (a
system library, called from "file_cleanup()"; Don't try to find any
connection between this function and the cause - it was probably a
pointer overflow). I tried to learn something from the stack of the
debugger, and after giving up, I tried "_apacher" and succeeded to
run. So I looked at the differences between "_apached" and "_apacher",
and found that instead of "/MD", "_apached" uses "/MDd"; I put this
instead of the "/MD" as the flag of the blamed object, and this time I
succeeded not only to link it, but also to run it (with "_apached").

Summary: Any C module or file which you want to link with the Apache,
you must compile with "/MD". If you build a debugging version of
Apache, use "/MDd". Omitting the "/MD" will cause the link to fail.
Using "/MD" instead of "/MDd" or vice versa, will cause your built
executable to crash.

Note: I know that "_apached" is not officially supported by mod_ssl; I
patched some files, like ApacheCore.mak and modules/ssl/Makefile.win32
and now it works beautifully. I sent Ralf the patches, so I hope he
will combine them in the upcoming 2.5.1-1.3.12, together with my other
waiting patches;  Ralf ???

-- 
Eli Marmor
[EMAIL PROTECTED]
El-Mar Software Ltd.
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to