Hi everyone,
I am working on an API wrapper that will use both MySQL and the Xalan xml api. My versions are: Xalan-C_1_8_0-windows_2000-msvc_60.zip (available at xml.apache.org) xerces-c_2_5_0-windows_nt-msvc_60.zip (available at xml.apache.org) mysql 4.0.20 windows 2000 professional service pack 4 microsoft visual c++ 6.0 The problem occurs when I include the mysql headers before the xalan headers. It is easy enough to reverse them, but since I am working on an API I cannot guarantee that my user will not include the mysql api before they include my wrapper api. Can anyone help? Below I am listing a code snippet that will compile, one that will not compile, and the errors that are produced from the bad code snippet. ################################################ # The following code compiles with no problems # ################################################ #include <xalanc/XMLSupport/XMLSupportDefinitions.hpp> #include <xalanc/XMLSupport/FormatterToXML.hpp> #include <my_global.h> #include <mysql.h> int main(int argc, char *argv[]) { return 0; } ####################################### # The following code will not compile # ####################################### #include <my_global.h> #include <mysql.h> #include <xalanc/XMLSupport/XMLSupportDefinitions.hpp> #include <xalanc/XMLSupport/FormatterToXML.hpp> int main(int argc, char *argv[]) { return 0; } ################################################################## # The following errors are produced by the 2nd set of code above # ################################################################## --------------------Configuration: TestXML - Win32 Debug-------------------- Compiling... TestXML.cpp c:\program files\microsoft visual studio\vc98\include\xutility(99) : error C2059: syntax error : '<end Parse>' c:\program files\microsoft visual studio\vc98\include\xutility(100) : error C2143: syntax error : missing ';' before '{' c:\program files\microsoft visual studio\vc98\include\xutility(100) : error C2447: missing function header (old-style formal list?) c:\program files\microsoft visual studio\vc98\include\xstring(19) : error C2954: template definitions cannot nest c:\program files\microsoft visual studio\vc98\include\xstring(41) : error C2065: '_Al' : undeclared identifier c:\program files\microsoft visual studio\vc98\include\xstring(597) : see reference to class template instantiation 'std::basic_string<_E,_Tr,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(41) : error C2440: 'type cast' : cannot convert from 'int' to 'class std::allocator' The target type has no constructors c:\program files\microsoft visual studio\vc98\include\xstring(597) : see reference to class template instantiation 'std::basic_string<_E,_Tr,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(41) : error C2056: illegal expression c:\program files\microsoft visual studio\vc98\include\xstring(597) : see reference to class template instantiation 'std::basic_string<_E,_Tr,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(41) : error C2071: 'basic_string<_E,_Tr,_A>::basic_string<_E,_Tr,_A>' : illegal storage class c:\program files\microsoft visual studio\vc98\include\xstring(597) : see reference to class template instantiation 'std::basic_string<_E,_Tr,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(41) : error C2461: 'basic_string<_E,_Tr,_A>' : constructor syntax missing formal parameters c:\program files\microsoft visual studio\vc98\include\xstring(597) : see reference to class template instantiation 'std::basic_string<_E,_Tr,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(42) : error C2146: syntax error : missing ';' before identifier 'basic_string' c:\program files\microsoft visual studio\vc98\include\xstring(597) : see reference to class template instantiation 'std::basic_string<_E,_Tr,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(600) : error C2039: 'npos' : is not a member of 'basic_string<_E,_Tr,_A>' c:\program files\microsoft visual studio\vc98\include\xstring(600) : error C2734: 'npos' : const object must be initialized if not extern c:\program files\microsoft visual studio\vc98\include\xstring(600) : error C2734: 'npos' : const object must be initialized if not extern c:\program files\microsoft visual studio\vc98\include\xstring(371) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(371) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(372) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(372) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(378) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(378) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(379) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\xstring(379) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : see reference to class template instantiation 'std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(219) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(219) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(220) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(220) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(226) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(226) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(227) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(227) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(244) : see reference to class template instantiation 'std::vector<_Ty,_A>' being compiled c:\program files\microsoft visual studio\vc98\include\vector(544) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(544) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(545) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(545) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(547) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(547) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(548) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(548) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(549) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(549) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(550) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(550) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(219) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(219) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(220) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(220) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(226) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(226) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(227) : error C2059: syntax error : '{' c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(227) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\program files\microsoft visual studio\vc98\include\vector(567) : see reference to class template instantiation 'std::vector<unsigned int,class std::allocator<unsigned int> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(219) : error C2059: syntax error : '{' c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(219) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(220) : error C2059: syntax error : '{' c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(220) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(226) : error C2059: syntax error : '{' c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(226) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(227) : error C2059: syntax error : '{' c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\program files\microsoft visual studio\vc98\include\vector(227) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(58) : see reference to class template instantiation 'std::vector<unsigned short,class std::allocator<unsigned short> >' being compiled c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(328) : error C2059: syntax error : '{' c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(328) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(329) : error C2059: syntax error : '{' c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(329) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body c:\xalan-c_1_8_0\include\xalanc\xalandom\xalandomstring.hpp(886) : fatal error C1903: unable to recover from previous error(s); stopping compilation Error executing cl.exe. TestXML.exe - 62 error(s), 0 warning(s) ********************************************************************** The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please re-send this communication to the sender and delete the original message or any copy of it from your computer system. Thank You. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]