RE: Unable to compile on Windows

View: New views
3 Messages — Rating Filter:   Alert me  

RE: Unable to compile on Windows

by Wang, Tony-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I'm new to xerces-c, I'm able to build the lib, dll, and sample
applications with the coming in solution/project files with Visual
Studio 2005.

However, when I try to use SAXparser in my application, I got compiler
errors as following. We use Visual Studio 2005 C++ compiler.

 

Thanks advance for your helps.

 

Tony

 

        cl -I. -I.././IDL -I.././Infrastructure  -I.././DB -I.././model
-Ic:\dev

\iona\include -Ic:\dev\versant\7_0_1\h -Ic:\dev\SourcePro
-I.././thirdparty/zlib

/include -IC:\dev\xerces_2_8_0\xerces-c-src_2_8_0/src -nologo -W3 -GR
-EHsc -vmg

 -Od -FD -EHsc -MD -Zi -Zm200 -DWIN32 -DCONSOLE -DPLATFORM_WIN32
-D_VC80_UPGRADE

=0x0710 -D_WINDOWS -DXML_USE_WIN32_TRANSCODER -DXML_USE_WIN32_MSGLOADER
-DXML_US

E_NETACCESSOR_WINSOCK -D_CRT_SECURE_NO_DEPRECATE -D_CRTDBG_MAP_ALLOC
-DWIN32_LEA

N_AND_MEAN -DVERSANT_ANSI -D_CRT_SECURE_NO_DEPRECATE  -D_AFXDLL -DNDEBUG
-DIT_U

SE_STD_IOSTREAM -DORBIX_DLL   -D_RWCONFIG=12d -D_CONSOLE
-DN_VERSANT_SUPPORT /Y

u"StdAfx.h" -c NCodianBridgeServer.cpp

NCodianBridgeServer.cpp

C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\src\xercesc/util/regx/Op.hpp(50)
: error

C2143: syntax error : missing '}' before 'constant'

C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\src\xercesc/util/regx/Op.hpp(50)
: error

C2059: syntax error : 'constant'

C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\src\xercesc/util/regx/Op.hpp(64)
: error

C2143: syntax error : missing ';' before '}'

*       More  --

 

Here is NCodianBridgeServer.cpp

//XERCES_CPP_NAMESPACE_BEGIN

#include <xercesc/util/PlatformUtils.hpp>

#include <xercesc/parsers/SAXParser.hpp>

#include <xercesc/framework/MemBufInputSource.hpp>

#include <xercesc/util/OutOfMemoryException.hpp>

//XERCES_CPP_NAMESPACE_END

 

// Get the input and output object stream declarations

#include <rw/http/RWHttpReply.h>

#include <rw/itc/RWTIOUResult.h>

#include <rw/internet/RWURL.h>

#include <rw/http/RWHttpRequestStringBody.h>

#include <rw/xmlabstractions/RWXmlReader.h>

#include <rw/http/RWHttpGenericHeader.h>

#include <rw/http/RWHttpContentTypeHeader.h>

#include <rw/http/RWHttpDate.h>

 

//PolycomAPI includes

 

#include "NMeetingStructs.hh"

#include <simpletypelist.h>

 

//Please insert other includes above this line

#include "NCodianBridgeServer.h"

 

#include "NCodianAPIHelper.h"

#include "NGlobalFuncs.h"

#define CUST_NAME_LENGTH 15

 

XERCES_CPP_NAMESPACE_USE

 

bool

NCodianBridgeServer::parseResponse(const NString & response,
NCodianRespParseHandler & parseHandler)

{

    const char * kFuncName = "NCodianBridgeServer::parseResponse";

    FUNCLOG(LOG_NPOLYCOMBRIDGESERVICEIMPL, kFuncName, ">>>" );

    const char*  gMemBufId = "prodInfo";

 

    // Initialize the XML4C2 system

    try

    {

         XMLPlatformUtils::Initialize();

    }

    catch (const XMLException& toCatch)

    {

         XERCES_STD_QUALIFIER cerr << "Error during initialization!
Message:\n"

              << StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER
endl;

         return false;

    }

 

    SAXParser::ValSchemes    valScheme = SAXParser::Val_Auto;

    bool doNamespaces       = false;

    bool doSchema           = false;

    bool schemaFullChecking = false;

 

    //  Create a SAX parser object. Then, according to what we were told
on

    //  the command line, set it to validate or not.

    //

 

    SAXParser* parser = new SAXParser();

    parser->setValidationScheme(valScheme);

    parser->setDoNamespaces(doNamespaces);

    parser->setDoSchema(doSchema);

    parser->setValidationSchemaFullChecking(schemaFullChecking);

 

    //

    //  Create our SAX handler object and install it on the parser, as
the

    //  document and error handlers.

    //

    parser->setDocumentHandler(&parseHandler);

    parser->setErrorHandler(&parseHandler);

 

    //

    //  Create MemBufferInputSource from the buffer containing the XML

    //  statements.

    //

    MemBufInputSource* memBufIS = new MemBufInputSource

    (

        (const XMLByte*) response

        , response.size()

        , gMemBufId

        , false

    );

 

    //start parsing

    unsigned int errorCode = 0;

    try

    {

        parser->parse(*memBufIS);

    }

    catch (const OutOfMemoryException&)

    {

        XERCES_STD_QUALIFIER cerr << "OutOfMemoryException" <<
XERCES_STD_QUALIFIER endl;

        errorCode = 5;

    }

    catch (const XMLException& e)

    {

        XERCES_STD_QUALIFIER cerr << "\nError during parsing memory
stream:\n"

             << "Exception message is:  \n"

             << StrX(e.getMessage()) << "\n" << XERCES_STD_QUALIFIER
endl;

        errorCode = 4;

    }

 

    //

    //  Delete the parser itself.  Must be done prior to calling
Terminate, below.

    //

    delete parser;

 

    delete memBufIS;

 

    // And call the termination method

    XMLPlatformUtils::Terminate();

 

    if(errorCode) {

        return false;

    }

    return true;

}

 

 

 

 


Re: Unable to compile on Windows

by David Bertoni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Wang, Tony wrote:

> Hi, I'm new to xerces-c, I'm able to build the lib, dll, and sample
> applications with the coming in solution/project files with Visual
> Studio 2005.
>
> However, when I try to use SAXparser in my application, I got compiler
> errors as following. We use Visual Studio 2005 C++ compiler.
>
> Thanks advance for your helps.
>
> Tony
>
>         cl -I. -I.././IDL -I.././Infrastructure  -I.././DB -I.././model
> -Ic:\dev\iona\include -Ic:\dev\versant\7_0_1\h -Ic:\dev\SourcePro
> -I.././thirdparty/zlib
>
> /include -IC:\dev\xerces_2_8_0\xerces-c-src_2_8_0/src -nologo -W3 -GR
> -EHsc -vmg
>
>  -Od -FD -EHsc -MD -Zi -Zm200 -DWIN32 -DCONSOLE -DPLATFORM_WIN32
> -D_VC80_UPGRADE
>
> =0x0710 -D_WINDOWS -DXML_USE_WIN32_TRANSCODER -DXML_USE_WIN32_MSGLOADER
> -DXML_US
>
> E_NETACCESSOR_WINSOCK -D_CRT_SECURE_NO_DEPRECATE -D_CRTDBG_MAP_ALLOC
> -DWIN32_LEA
>
> N_AND_MEAN -DVERSANT_ANSI -D_CRT_SECURE_NO_DEPRECATE  -D_AFXDLL -DNDEBUG
> -DIT_U
>
> SE_STD_IOSTREAM -DORBIX_DLL   -D_RWCONFIG=12d -D_CONSOLE
> -DN_VERSANT_SUPPORT /Y
>
> u"StdAfx.h" -c NCodianBridgeServer.cpp
>
> NCodianBridgeServer.cpp
>
> C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\src\xercesc/util/regx/Op.hpp(50)
> : error
>
> C2143: syntax error : missing '}' before 'constant'
Perhaps your code or some other code you're including defines a macro
that is the same as one of the enums in the Op class.

You can try adding the following line to the Op.hpp, right before the
start of the Op class:

#undef O_STRING
#undef O_CLOSURE

Dave

RE: Unable to compile on Windows

by Wang, Tony-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dave, thanks for your help. After adding the 2 line in Op.hpp, I 'm able
to compile my code. However, I got a unresolved link error. I added all
the 2 libraries in my Makefile:
C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\Build\Win32\VC8\Debug\xerces-c_2D
.lib
C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\Build\Win32\VC8\Debug\xerces-depd
om_2D.lib

Do you have any clue why?

Thanks a lot

Tony


        link -out:NCodianBridgeService.exe -nologo -debug
-nodefaultlib:libcmt.
lib -nodefaultlib:libcimt.lib  -force:multiple NCodianBridgeService.obj
NCodian
BridgeServiceImpl.obj  NCodianBridgeServer.obj  NCodianAPIHelper.obj
NCodianRes
pParseHandler.obj  NCodianXMLStrMember.obj  NCodianXMLIntMember.obj
NCodianXMLD
TMember.obj  NCodianXMLBoolMember.obj  NCodianXMLMember.obj
.././IDL/SessionMngr
S.obj  .././IDL/NCodianBridgeServiceS.obj  .././IDL/NEntityIFCS.obj
.././ID
L/NIDLExceptionsC.obj  .././IDL/NIDLSessionObjectS.obj
.././IDL/NCallBackRegist
ryS.obj  .././IDL/NCallBackC.obj  .././IDL/NIDLTypesModC.obj
.././IDL/NBillingT
ypesC.obj  .././IDL/NServerBaseS.obj  .././IDL/NEmailServiceC.obj
.././IDL/CosN
amingS.obj       .././IDL/BridgeServerStructsC.obj .././model/nModel.lib
.././D
B/db.lib  .././Infrastructure/Infrastructure.lib
c:\dev\versant\7_0_1\lib/msccls
.lib c:\dev\versant\7_0_1\lib/mscvcoll.lib
c:\dev\versant\7_0_1\lib/liboscfe.lib
 c:\dev\iona\lib/itmi.lib c:\dev\SourcePro\lib/tls12d.lib
c:\dev\SourcePro\lib/t
hread12d.lib c:\dev\SourcePro\lib/sync12d.lib
c:\dev\SourcePro\lib/threxcept12d.
lib c:\dev\SourcePro\lib/functor12d.lib
c:\dev\SourcePro\lib/functor_map12d.lib
c:\dev\SourcePro\lib/functor_list12d.lib
c:\dev\SourcePro\lib/pointer12d.lib c:\
dev\SourcePro\lib/itc12d.lib c:\dev\SourcePro\lib/network12d.lib
c:\dev\SourcePr
o\lib/http12d.lib c:\dev\SourcePro\lib/internet12d.lib
c:\dev\SourcePro\lib/ftp1
2d.lib c:\dev\SourcePro\lib/smtp12d.lib
c:\dev\SourcePro\lib/xmlstreams12d.lib c
:\dev\SourcePro\lib/xmlabstractions12d.lib
c:\dev\SourcePro\lib/serial12d.lib c:
\dev\SourcePro\lib/streams12d.lib c:\dev\SourcePro\lib/factory12d.lib
c:\dev\Sou
rcePro\lib/types12d.lib kernel32.lib wsock32.lib advapi32.lib user32.lib
.././th
irdparty/zlib/lib/zlib.lib
C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\Build\Win32\VC8\Debug\xerces-c_2D
.lib
C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\Build\Win32\VC8\Debug\xerces-depd
om_2D.lib
NCodianBridgeServer.obj : error LNK2001: unresolved external symbol
"public: static class xercesc_2_8::MemoryManager *
xercesc_2_8::XMLPlatformUtils::fgMemoryManager"
(?fgMemoryManager@XMLPlatformUtils@xercesc_2_8@@2PAVMemoryManager@2@A)
NCodianBridgeServer.obj : error LNK2001: unresolved external symbol
"public: static char const * const
xercesc_2_8::XMLUni::fgXercescDefaultLocale"
(?fgXercescDefaultLocale@XMLUni@xercesc_2_8@@2QBDB)
NCodianBridgeService.exe : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: 'C:\dev\VisualStudio\vc\bin\link.EXE' :
return code '
0x460'
Stop.

-----Original Message-----
From: David Bertoni [mailto:dbertoni@...]
Sent: Thursday, July 03, 2008 6:46 PM
To: c-users@...
Subject: Re: Unable to compile on Windows

Wang, Tony wrote:

> Hi, I'm new to xerces-c, I'm able to build the lib, dll, and sample
> applications with the coming in solution/project files with Visual
> Studio 2005.
>
> However, when I try to use SAXparser in my application, I got compiler
> errors as following. We use Visual Studio 2005 C++ compiler.
>
> Thanks advance for your helps.
>
> Tony
>
>         cl -I. -I.././IDL -I.././Infrastructure  -I.././DB
-I.././model

> -Ic:\dev\iona\include -Ic:\dev\versant\7_0_1\h -Ic:\dev\SourcePro
> -I.././thirdparty/zlib
>
> /include -IC:\dev\xerces_2_8_0\xerces-c-src_2_8_0/src -nologo -W3 -GR
> -EHsc -vmg
>
>  -Od -FD -EHsc -MD -Zi -Zm200 -DWIN32 -DCONSOLE -DPLATFORM_WIN32
> -D_VC80_UPGRADE
>
> =0x0710 -D_WINDOWS -DXML_USE_WIN32_TRANSCODER
-DXML_USE_WIN32_MSGLOADER
> -DXML_US
>
> E_NETACCESSOR_WINSOCK -D_CRT_SECURE_NO_DEPRECATE -D_CRTDBG_MAP_ALLOC
> -DWIN32_LEA
>
> N_AND_MEAN -DVERSANT_ANSI -D_CRT_SECURE_NO_DEPRECATE  -D_AFXDLL
-DNDEBUG

> -DIT_U
>
> SE_STD_IOSTREAM -DORBIX_DLL   -D_RWCONFIG=12d -D_CONSOLE
> -DN_VERSANT_SUPPORT /Y
>
> u"StdAfx.h" -c NCodianBridgeServer.cpp
>
> NCodianBridgeServer.cpp
>
>
C:\dev\xerces_2_8_0\xerces-c-src_2_8_0\src\xercesc/util/regx/Op.hpp(50)
> : error
>
> C2143: syntax error : missing '}' before 'constant'
Perhaps your code or some other code you're including defines a macro
that is the same as one of the enums in the Op class.

You can try adding the following line to the Op.hpp, right before the
start of the Op class:

#undef O_STRING
#undef O_CLOSURE

Dave
LightInTheBox - Buy quality products at wholesale price