Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 818ABF9E8 for ; Sun, 31 Mar 2013 10:21:01 +0000 (UTC) Received: (qmail 79934 invoked by uid 500); 31 Mar 2013 10:21:01 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 79803 invoked by uid 500); 31 Mar 2013 10:21:00 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 79764 invoked by uid 99); 31 Mar 2013 10:20:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Mar 2013 10:20:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sorinm@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-wg0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Mar 2013 10:20:52 +0000 Received: by mail-wg0-f44.google.com with SMTP id z12so1381135wgg.23 for ; Sun, 31 Mar 2013 03:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=BA5xBz2F1qNGgiWKc9QgSIC9RwcwwbTv4ArCwt/kUuA=; b=khnxuZjbOM/jHYhR/4TWt/aONSn5GLz9A7eGT+zOFoyCtX9Nyikkaze32sx+867/TO FIOKY3hayCmq/7+To8hUMCjMO+NJUn4j0VebpgultTOLv91PKcZIQepeqHG9pHTrftHU s2oC4cpNTyN9qrdD5qPRXrEq7fCzr2VQgjtDX72Glelf9cXvPi+PlxlbfMKKvqhSQiVw xFR/+8Dv52/DwXTJsgV33DW0czUIOV5xHoOvx50g0ZuAX/yq4IqsDOq/2XYFoXGgLGZI sNDdCkjVREAC3n3a3R4dUb8IC0aeeDkVM7BkMJMJnl6nbDCYhGC8dHVlVnqmX1l2WSVT PT4w== X-Received: by 10.194.109.136 with SMTP id hs8mr11132299wjb.8.1364725231399; Sun, 31 Mar 2013 03:20:31 -0700 (PDT) Received: from ?IPv6:2a01:e35:8b73:8dd0:762f:68ff:fee5:8d8? ([2a01:e35:8b73:8dd0:762f:68ff:fee5:8d8]) by mx.google.com with ESMTPS id h10sm8428587wic.8.2013.03.31.03.20.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 Mar 2013 03:20:30 -0700 (PDT) Message-ID: <51580DE6.2080205@gmail.com> Date: Sun, 31 Mar 2013 12:20:22 +0200 From: Sorin Manolache User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130112 Icedove/17.0.2 MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Re: Apache fails to start when Xerces library is used in a C++ module References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 2013-03-31 11:06, Sindhi Sindhi wrote: > 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: The 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 appreciated. Hello, Try LoadFile /absolute/path/to/the/xerces/lib1 LoadFile /absolute/path/to/the/xerces/lib2 ... LoadModule /absolute/path/to/XercesDLL.dll For example LoadFile E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\lib\xerces-c_3.lib and xerces-c_static_3.lib LoadFile E:\xerces-c-3.1.1-x86_64-windows-vc-10.0\xerces-c-3.1.1-x86_64-windows-vc-10.0\lib\xerces-c_3.lib and xerces-c_3.lib LoadModule E:\workspace\XercesDLL.dll Maybe you do not need both LoadFiles. Experiment. Sorin