You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Stone, Timothy M" <ts...@ida.org> on 2010/07/22 16:28:38 UTC

Error message not appearing with static bvuild

Greetings,

I have created dynamic (.dll) and static (.lib) xerces 3.0.1 library for VC6.

I did this by using the supplied project to create the .dll, then manually linking the created object files to create the .lib.

This worked with no errors, and after I added XERCES_STATIC_LIBRARY to my project, I was able to use the static library.


Unfortunately, when I use the static library, the simple error handler I am using to print the error information does not print the error message.  I am using the code Boris sent out previously on 3/15/2010 to load and test am xml against an xsd.

The code is below (copied from the code Boris mailed previously and added a bit more to the print).


My output when using the .dll is:
  F:\E023N11.xml line 863 column 72:
     Fatal Error: prefix 'testBadPrefix' can not be resolved to namespace URI


My output when using the .lib is:
  F:\E023N11.xml line 863 column 72:
     Fatal Error:


So, everything is working (uri, line number, column number, error severity)...just not the error message (msg).


Code below...can anyone help?  It is probably something simple.

bool error_handler::handleError (const xercesc::DOMError& e)
{
  DOMLocator* loc = e.getLocation ();

  char* uri = XMLString::transcode (loc->getURI ());
  char* msg = XMLString::transcode (e.getMessage ());

  printf("%s line %d column %d:\n   %s: %s\n\n",uri,(int)loc->getLineNumber(),(int)loc->getColumnNumber(),GetWarnType(e.getSeverity()),msg);
}

Re: Error message not appearing with static bvuild

Posted by "Stone, Timothy M" <ts...@ida.org>.

Thank you, that worked.

So, it seems fairly simple to build static xerces library with supplied dynamic build project:

1) Change XERCES_USE_WIN32_MSGLOADER to XERCES_USE_MSGLOADER_INMEMORY
2) Build XercesLib project as normal.
3) Link created object files into new static library (go into "obj" and "lib *.obj *.res /OUT:xerces30static.lib")


On 7/23/10 8:41 AM, "Vitaly Prapirny" <ma...@mebius.net> wrote:

> Hi,
>
> I suppose you should use XERCES_USE_MSGLOADER_INMEMORY define and
> InMemMsgLoader.obj file when building static library and VC6 DLL project
> are using XERCES_USE_WIN32_MSGLOADER define and Win32MsgLoader.obj file
> instead.
>
> Good luck!
>         Vitaly
>
> Stone, Timothy M wrote:
>>
>> Greetings,
>>
>> I have created dynamic (.dll) and static (.lib) xerces 3.0.1 library for
>> VC6.
>>
>> I did this by using the supplied project to create the .dll, then
>> manually linking the created object files to create the .lib.
>>
>> This worked with no errors, and after I added XERCES_STATIC_LIBRARY to
>> my project, I was able to use the static library.
>>
>>
>> Unfortunately, when I use the static library, the simple error handler I
>> am using to print the error information does not print the error
>> message. I am using the code Boris sent out previously on 3/15/2010 to
>> load and test am xml against an xsd.
>>
>> The code is below (copied from the code Boris mailed previously and
>> added a bit more to the print).
>>
>>
>> My output when using the .dll is:
>> F:\E023N11.xml line 863 column 72:
>> Fatal Error: prefix 'testBadPrefix' can not be resolved to namespace URI
>>
>>
>> My output when using the .lib is:
>> F:\E023N11.xml line 863 column 72:
>> Fatal Error:
>>
>>
>> So, everything is working (uri, line number, column number, error
>> severity)...just not the error message (msg).
>>
>>
>> Code below...can anyone help? It is probably something simple.
>>
>> bool error_handler::handleError (const xercesc::DOMError& e)
>> {
>> DOMLocator* loc = e.getLocation ();
>>
>> char* uri = XMLString::transcode (loc->getURI ());
>> char* msg = XMLString::transcode (e.getMessage ());
>>
>> printf("%s line %d column %d:\n %s:
>> %s\n\n",uri,(int)loc->getLineNumber(),(int)loc->getColumnNumber(),GetWarnType
>> (e.getSeverity()),msg);
>> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
>
>

Re: Error message not appearing with static bvuild

Posted by Vitaly Prapirny <ma...@mebius.net>.
Hi,

I suppose you should use XERCES_USE_MSGLOADER_INMEMORY define and 
InMemMsgLoader.obj file when building static library and VC6 DLL project 
are using XERCES_USE_WIN32_MSGLOADER define and Win32MsgLoader.obj file 
instead.

Good luck!
	Vitaly

Stone, Timothy M wrote:
>
> Greetings,
>
> I have created dynamic (.dll) and static (.lib) xerces 3.0.1 library for
> VC6.
>
> I did this by using the supplied project to create the .dll, then
> manually linking the created object files to create the .lib.
>
> This worked with no errors, and after I added XERCES_STATIC_LIBRARY to
> my project, I was able to use the static library.
>
>
> Unfortunately, when I use the static library, the simple error handler I
> am using to print the error information does not print the error
> message. I am using the code Boris sent out previously on 3/15/2010 to
> load and test am xml against an xsd.
>
> The code is below (copied from the code Boris mailed previously and
> added a bit more to the print).
>
>
> My output when using the .dll is:
> F:\E023N11.xml line 863 column 72:
> Fatal Error: prefix 'testBadPrefix' can not be resolved to namespace URI
>
>
> My output when using the .lib is:
> F:\E023N11.xml line 863 column 72:
> Fatal Error:
>
>
> So, everything is working (uri, line number, column number, error
> severity)...just not the error message (msg).
>
>
> Code below...can anyone help? It is probably something simple.
>
> bool error_handler::handleError (const xercesc::DOMError& e)
> {
> DOMLocator* loc = e.getLocation ();
>
> char* uri = XMLString::transcode (loc->getURI ());
> char* msg = XMLString::transcode (e.getMessage ());
>
> printf("%s line %d column %d:\n %s:
> %s\n\n",uri,(int)loc->getLineNumber(),(int)loc->getColumnNumber(),GetWarnType(e.getSeverity()),msg);
> }


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org