[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    [users@httpd] Apache fails to start when Xerces library is used in a C++ module
From:       Sindhi Sindhi <sindhi.for () gmail ! com>
Date:       2013-03-31 7:58:49
Message-ID: CANOjuGE3Pjo9J7qkKenOoAUN76y2+8D4k842Sk-2-aSTFL5uOA () mail ! gmail ! com
[Download RAW message or body]

Hello,

I have written a C++ module to invoke the Xerces C++ XML library to parse a
XML file. I'm unable to start httpd.exe with these changes. Here are the
details -

a) Apache server version: httpd-2.4.4-win64
b) Xerces version: xerces-c-3.1.1-x86_64-windows-vc-10.0
c) Development envt: Visual Studio 2010 with SP1

Following are the settings I have made in Visual Studio so that the C++
module refers to the Xerces library:
1. Additional Include Directories =
E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\include

2. Additional Dependencies = xerces-c_3.lib and xerces-c_static_3.lib

3. Additional library directories =
E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\lib

4. Debugging -> Environment:
PATH=E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\bin

5. In the Operating System environment variables, added the path
E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\bin
to the environment variable PATH

6. The code in my C++ module to invoke the Xerces library routine goes like
this -

try {
XMLPlatformUtils::Initialize();  // Initialize Xerces infrastructure
}
catch( XMLException& e ) {
char* message = XMLString::transcode( e.getMessage() );
XMLString::release( &message );
}
XMLPlatformUtils::Terminate();

7. Added the below in httpd.conf file -
LoadModule filter_module modules/XercesDLL.dll
AddOutputFilterByType TagFilter text/html text/plain text/css

8. If i try to launch httpd.exe from command prompt, I see the below error -
>httpd.exe
*httpd.exe: Syntax error on line 172 of
E:/httpd-2.4.4-win64/Apache24/conf/httpd.conf: Cannot load
modules/XercesDLL.dll into server: T*
*he specified module could not be found.*

Even if I comment out the above C++ code in step 6, Apache still fails to
start. That means Apache is failing to load the Xerces library version
I'm using, irrespective of the way I'm invoking the library.

However, If I write a standalone DLL that invokes the above Xerces library
version, and invoke this DLL from an EXE then I'm successfully able to
parse the XML. This means, the Xerces library fails to get loaded only by
the Apache server for some reason.

I think its got something to do with the C to C++ linkage, not sure tho.

Any help is highly apreciated.

Thanks.

[Attachment #3 (text/html)]

<div>Hello,</div><div><br></div><div>I have written a C++ module to invoke the Xerces \
C++ XML library to parse a XML file. I&#39;m unable to start httpd.exe with these \
changes. Here are the details -</div><div><br></div><div> a) Apache server version: \
httpd-2.4.4-win64</div><div>b) Xerces version: \
xerces-c-3.1.1-x86_64-windows-vc-10.0</div><div>c) Development envt: Visual Studio \
2010 with SP1</div><div><br></div><div>Following are the settings I have made in \
Visual Studio so that the C++ module refers to the Xerces library:</div> <div>1. \
Additional Include Directories = \
E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\include</div><div><br></div><div>2. \
Additional Dependencies = xerces-c_3.lib and xerces-c_static_3.lib</div> \
<div><br></div><div>3. Additional library directories = \
E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\lib</div><div><br></div><div>4. \
Debugging -&gt; Environment: \
PATH=E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\bin</div>
 <div><br></div><div>5. In the Operating System environment variables, added the path \
E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\bin to \
the environment variable PATH</div><div><br></div> <div>6. The code in my C++ module \
to invoke the Xerces library routine goes like this -</div><div><br></div><div>try { \
</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>XMLPlatformUtils::Initialize();  // Initialize Xerces \
infrastructure</div> <div>}</div><div>catch( XMLException&amp; e ) {</div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>char* message = \
XMLString::transcode( e.getMessage() );</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>XMLString::release( &amp;message );</div> \
<div>}</div><div>XMLPlatformUtils::Terminate();<span class="Apple-tab-span" \
style="white-space:pre">	</span></div><div><br></div><div>7. Added the below in \
httpd.conf file -</div><div>LoadModule filter_module modules/XercesDLL.dll</div> \
<div>AddOutputFilterByType TagFilter text/html text/plain \
text/css</div><div><br></div><div>8. If i try to launch httpd.exe from command \
prompt, I see the below error -</div><div>&gt;httpd.exe</div><div><b>httpd.exe: \
Syntax error on line 172 of E:/httpd-2.4.4-win64/Apache24/conf/httpd.conf: Cannot \
load modules/XercesDLL.dll into server: T</b></div> <div><b>he specified module could \
not be found.</b></div><div><br></div><div>Even if I comment out the above C++ code \
in step 6, Apache still fails to start. That means Apache is failing to load the \
Xerces library version I&#39;m using, irrespective of the way I&#39;m invoking the \
library.</div> <div><br></div><div>However, If I write a standalone DLL that invokes \
the above Xerces library version, and invoke this DLL from an EXE then I&#39;m \
successfully able to parse the XML. This means, the Xerces library fails to get \
loaded only by the Apache server for some reason.</div> <div><br></div><div>I think \
its got something to do with the C to C++ linkage, not sure \
tho.</div><div><br></div><div>Any help is highly \
apreciated.</div><div><br></div><div>Thanks.</div><div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic