You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Eric Roy <xw...@gmail.com> on 2009/04/30 02:18:13 UTC
XOgastan work with xerces
I'm trying to make XOgastan\src xxx.cpp to xxx.o.
I included the XMLString.hpp in the XOgastan\src\include\utils\a2b.h.
But when i make it in BashShell(cygwin) like this:
/cygdrive/c/xogastan/src/utils
$ make
It shows:
g++ -c -DLINUX -D_REENTRANT -fpic -I/usr/include -I/src/include
-I/include -o a2b.o b2b.cpp
a2b.cpp:1: warning -fpic ignored for target (all code is position
independent)
a2b.cpp: In static member function 'static std::string
a2b::XMLChar2string(const XMLCh*)':
a2b.cpp:107: error: 'XMLString' has not been declared
a2b.cpp:107: error: 'transcode' undeclared (first use this function)
a2b.cpp:107: error: (Each undeclared identifier is reported only once for
each function it appears in.)
make: *** [a2b.o] Error 1
Here is code where the error apears(a2b.cpp):
string
a2b::XMLChar2string(const XMLCh* const toTranscode) {
string target_string;
char *char_string;
// Call the private transcoding method
char_string = XMLString::transcode(toTranscode);
// save in string
target_string = char_string;
// free memory
delete char_string;
// return the string saved
return target_string;
}
Does anyone can help me ? Thanks a lot.
--
View this message in context: http://www.nabble.com/XOgastan-work-with-xerces-tp23302627p23302627.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.
Re: XOgastan work with xerces
Posted by David Bertoni <db...@apache.org>.
Eric Roy wrote:
>
>
> David Bertoni wrote:
>> Eric Roy wrote:
>>> I'm trying to make XOgastan\src xxx.cpp to xxx.o.
>>> I included the XMLString.hpp in the XOgastan\src\include\utils\a2b.h.
>>> But when i make it in BashShell(cygwin) like this:
>>> /cygdrive/c/xogastan/src/utils
>>> $ make
>>>
>>> It shows:
>>> g++ -c -DLINUX -D_REENTRANT -fpic -I/usr/include -I/src/include
>>> -I/include -o a2b.o b2b.cpp
>>> a2b.cpp:1: warning -fpic ignored for target (all code is position
>>> independent)
>>> a2b.cpp: In static member function 'static std::string
>>> a2b::XMLChar2string(const XMLCh*)':
>>> a2b.cpp:107: error: 'XMLString' has not been declared
>>> a2b.cpp:107: error: 'transcode' undeclared (first use this function)
>>> a2b.cpp:107: error: (Each undeclared identifier is reported only once for
>>> each function it appears in.)
>>> make: *** [a2b.o] Error 1
>>>
>>> Here is code where the error apears(a2b.cpp):
>>> string
>>> a2b::XMLChar2string(const XMLCh* const toTranscode) {
>>>
>>> string target_string;
>>> char *char_string;
>>>
>>> // Call the private transcoding method
>>> char_string = XMLString::transcode(toTranscode);
>> You probably need to qualify these names with the Xerces-C namespace.
>> There are some handy macros you can use:
>>
>> char_string = XERCES_CPP_NAMESPACE_QUALIFIER
>> XMLString::transcode(toTranscode);
>>
>> Or, you can having using declarations:
>>
>> using XERCES_CPP_NAMESPACE_QUALIFIER XMLString;
>> char_string = XMLString::transcode(toTranscode);
>>
>> Dave
>>
>>
>
> I just spend 2 hours figure it out.
> It needs a namespace.
> I add:
>
> using namespace std;
> XERCES_CPP_NAMESPACE_USE
>
> in the header files
> all problems solved.
> but when i make the dir"xmlmanager", I also need change the include headers
> like "<dom/dom.hpp>" to the right path like
> "<C:/xerces-c-src_2_8_0/src/xercesc/dom/deprecated/DOM.hpp>"
You don't need to do that. You can just use a compiler or project
option to add the Xerces-C include directory to the list of directories
the compiler will search.
Dave
Re: XOgastan work with xerces
Posted by Eric Roy <xw...@gmail.com>.
David Bertoni wrote:
>
> Eric Roy wrote:
>> I'm trying to make XOgastan\src xxx.cpp to xxx.o.
>> I included the XMLString.hpp in the XOgastan\src\include\utils\a2b.h.
>> But when i make it in BashShell(cygwin) like this:
>> /cygdrive/c/xogastan/src/utils
>> $ make
>>
>> It shows:
>> g++ -c -DLINUX -D_REENTRANT -fpic -I/usr/include -I/src/include
>> -I/include -o a2b.o b2b.cpp
>> a2b.cpp:1: warning -fpic ignored for target (all code is position
>> independent)
>> a2b.cpp: In static member function 'static std::string
>> a2b::XMLChar2string(const XMLCh*)':
>> a2b.cpp:107: error: 'XMLString' has not been declared
>> a2b.cpp:107: error: 'transcode' undeclared (first use this function)
>> a2b.cpp:107: error: (Each undeclared identifier is reported only once for
>> each function it appears in.)
>> make: *** [a2b.o] Error 1
>>
>> Here is code where the error apears(a2b.cpp):
>> string
>> a2b::XMLChar2string(const XMLCh* const toTranscode) {
>>
>> string target_string;
>> char *char_string;
>>
>> // Call the private transcoding method
>> char_string = XMLString::transcode(toTranscode);
> You probably need to qualify these names with the Xerces-C namespace.
> There are some handy macros you can use:
>
> char_string = XERCES_CPP_NAMESPACE_QUALIFIER
> XMLString::transcode(toTranscode);
>
> Or, you can having using declarations:
>
> using XERCES_CPP_NAMESPACE_QUALIFIER XMLString;
> char_string = XMLString::transcode(toTranscode);
>
> Dave
>
>
I just spend 2 hours figure it out.
It needs a namespace.
I add:
using namespace std;
XERCES_CPP_NAMESPACE_USE
in the header files
all problems solved.
but when i make the dir"xmlmanager", I also need change the include headers
like "<dom/dom.hpp>" to the right path like
"<C:/xerces-c-src_2_8_0/src/xercesc/dom/deprecated/DOM.hpp>"
I just finished my whole work.
Thank you , Dave.
I hope my solution can help anyone who has problems like me.
--
View this message in context: http://www.nabble.com/XOgastan-work-with-xerces-tp23302627p23325704.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.
Re: XOgastan work with xerces
Posted by David Bertoni <db...@apache.org>.
Eric Roy wrote:
> I'm trying to make XOgastan\src xxx.cpp to xxx.o.
> I included the XMLString.hpp in the XOgastan\src\include\utils\a2b.h.
> But when i make it in BashShell(cygwin) like this:
> /cygdrive/c/xogastan/src/utils
> $ make
>
> It shows:
> g++ -c -DLINUX -D_REENTRANT -fpic -I/usr/include -I/src/include
> -I/include -o a2b.o b2b.cpp
> a2b.cpp:1: warning -fpic ignored for target (all code is position
> independent)
> a2b.cpp: In static member function 'static std::string
> a2b::XMLChar2string(const XMLCh*)':
> a2b.cpp:107: error: 'XMLString' has not been declared
> a2b.cpp:107: error: 'transcode' undeclared (first use this function)
> a2b.cpp:107: error: (Each undeclared identifier is reported only once for
> each function it appears in.)
> make: *** [a2b.o] Error 1
>
> Here is code where the error apears(a2b.cpp):
> string
> a2b::XMLChar2string(const XMLCh* const toTranscode) {
>
> string target_string;
> char *char_string;
>
> // Call the private transcoding method
> char_string = XMLString::transcode(toTranscode);
You probably need to qualify these names with the Xerces-C namespace.
There are some handy macros you can use:
char_string = XERCES_CPP_NAMESPACE_QUALIFIER
XMLString::transcode(toTranscode);
Or, you can having using declarations:
using XERCES_CPP_NAMESPACE_QUALIFIER XMLString;
char_string = XMLString::transcode(toTranscode);
Dave