Dear Linux c/g++ programers:
when I tried to test/compile a piece msvc++ workable code on my g++4.5.2 on
linux 2.6.38-10
I got compile errors
root@eric-laptop:/home/eric/cppcookbook/ch14# g++ Example14-8.cpp
In file included from Example14-8.cpp:9:0:
xerces_strings.hpp: In function ‘std::string toNative(const XMLCh*)’:
xerces_strings.hpp:26:34: error: expected initializer before ‘<’ token
xerces_strings.hpp:27:24: error: ‘ptr’ was not declared in this scope
-------------------------------
my xerces_strings.hpp
------------26, 27----------
Code:
boost::scoped_array<char> ptr<xercesc::XMLString::transcode(str));
return std::string(ptr.get());
I have a similar code with ptr, but my g++ did not complain error which is
used in XercesString(ptr.get());
looking to see experts' help and thanks a lot in advance, Eric