> -----Original Message-----
> From: Jess Balint [mailto:jba...@mysql.com]
> Sent: Tuesday, September 18, 2007 8:45 PM
> To: Ron Hu
> Cc: inte...@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=r...@scaledb.com
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=mysql-i...@freebsd.csie.nctu.edu.tw