RE: Windows compilation errors C2766, C2535
Thanks Jess for answering my question. It did solve the problem after I
moved STL headers before MySQL headers
-Ron
> -----Original Message----- > From: Jess Balint [mailto:jbalint@mysql.com] > Sent: Tuesday, September 18, 2007 8:45 PM > To: Ron Hu > Cc: internals@lists.mysql.com > Subject: Re: Windows compilation errors C2766, C2535 > > Ron, > Try moving the STL headers before the MySQL headers. > > Jess > > On Tue, Sep 18, 2007 at 04:33:03PM -0700, Ron Hu wrote: > > Hi, > > > > I created a new library to be linked with mysqld.exe. My > code has the > > following include files: > > > > #include "mysql_priv.h" > > #include <sys/types.h> > > #include <sys/stat.h> > > #include "my_dir.h" > > > > #include <string> > > #include <vector> > > #include <iostream> > > > > #include "mysql/plugin.h" > > > > I first built MySQL5.1 code without my library using Windows Visual > > Studio 2005. It succeeded without problem. Then I tried > to compile > > my library and received these error messages: > > > > C:\Program Files\Microsoft Visual Studio > 8\VC\include\xutility(720) : > > error > > C2766: explicit specialization; 'std::iterator_traits' has already > > been defined > > C:\Program Files\Microsoft Visual Studio > > 8\VC\include\xutility(641) > > : see previous definition of 'iterator_traits' > > C:\Program Files\Microsoft Visual Studio > 8\VC\include\xutility(1200) : > > error > > C2766: explicit specialization; 'std::_Ptr_cat_helper' has already > > been defined > > C:\Program Files\Microsoft Visual Studio > > 8\VC\include\xutility(1111) > > : see previous definition of '_Ptr_cat_helper' > > C:\Program Files\Microsoft Visual Studio > 8\VC\include\ostream(268) : > > error > > C2535: 'std::basic_ostream<_Elem,_Traits> > > &std::basic_ostream<_Elem,_Traits>::operator > <<(std::_Bool)' : member > > function already defined or declared > > C:\Program Files\Microsoft Visual Studio > 8\VC\include\ostream(194) : > > see declaration of 'std::basic_ostream<_Elem,_Traits>::operator <<' > > C:\Program Files\Microsoft Visual Studio > 8\VC\include\ostream(587) : > > see reference to class template instantiation > > 'std::basic_ostream<_Elem,_Traits>' being compiled > > > > It appears that C++ STL <string> <vector> <iostream> has conflicts > > with the existing MySQL header files. How can I go around the > > problem? Any comments will be greatly appreciated. > > > > Thanks. > > > > -Ron > > > > -- > MySQL Internals Mailing List > For list archives: http://lists.mysql.com/internals > To unsubscribe: > http://lists.mysql.com/internals?unsub=ron@scaledb.com
--
MySQL Internals Mailing List
For list archives:
http://lists.mysql.com/internals
To unsubscribe:
http://lists.mysql.com/internals?unsub=lists@pantek.com
Received on Wed Sep 19 14:43:48 2007
This archive was generated by hypermail 2.1.8
: Sun Oct 07 2007 - 07:59:32 EDT
|