I run: --------- c++ -Wno-deprecated -lmysqlclient qDB.cpp -o qDB -L/usr/lib/mysql -L/usr/lib/libsqlplus.so -I/usr/include/mysql -I/usr/include/mysql++ And I get: -------------- qDB.cpp: In function `int main()': qDB.cpp:20: error: ISO C++ says that `std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>]' and `SQLQuery& operator<<(SQLQuery&, const mysql_ColData<const_string>&)' are ambiguous even though the worst conversion for the former is better than the worst conversion for the latter qDB.cpp:20: error: ISO C++ says that `std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>]' and `SQLQuery& operator<<(SQLQuery&, const mysql_ColData<std::string>&)' are ambiguous even though the worst conversion for the former is better than the worst conversion for the latter make: *** [qDB] Error 1 Reproducible: Always Steps to Reproduce: 1. emerge mysql++ 2. create a c++ aplication that uses mysql++ API 3. compile it and you'll see it failes (if you have gcc 3.3.2) liviu@starshooter newtMysql $ emerge info Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.3-gentoo-r1) ================================================================= System uname: 2.6.3-gentoo-r1 i686 AMD Athlon(tm) XP 2600+ Gentoo Base System version 1.4.3.13 ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.7.7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox userpriv usersandbox" GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://sunsite.cnlab-switch.ch/ftp/mirror/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://gentoo.tiscali.nl/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="3dnow X acpi alsa apm arts avi berkdb crypt cscope dga dvd encode esd flash foomaticdb foreign-package foreign-sysvinit freetype gd gdbm ggz gif gnome gpm gtk gtk2 gtkhtml imlib java javascript jpeg kde libg++ libwww mad mikmod mmx motif mozcalendar mozilla moznoirc mozsvg mpeg mysql ncurses nls odbc oggvorbis opengl openssh oss pam pdflib perl php png python qt qtmt quicktime readline regexp samba sasl sdk sdl slang speedo speex spell sse ssl svga tcltk tcpd tetex threads tiff truetype type1 unicode v4l vim-with-x wxwindows x86 xfs xml xml2 xmms xosd xv xvid zlib"
Created attachment 28105 [details] MySQL++ Example What file are you trying to compile? I just tried one of the examples from the tutorial here: http://www.mysql.com/documentation/mysql++/ Which I've attached, and it compiles just fine using: c++ -Wno-deprecated mysql++_example.cpp -o mysql++_example -L/usr/lib/mysql -L/usr/lib/libsqlplus.so -I/usr/include/mysql -I/usr/include/mysql++ -lsqlplus
Yea, you compiled but it does not work, doesn't it? Why? Look at your sample and to this (original one): http://www.mysql.com/documentation/mysql++/4_Tutorial.html#SECTION03142000000000000000 The prob is here: <code> .. .. Query query = con.query(); query << "select * from Users"; .. .. </code> The compilation failes on query << "select * from Users"; Your sample is not correct at all, yes it does compile but have you tried to run it? I guess not! <your_code> // Query query = con.query(); con.query() << "select * from stock"; </your_code> What is the point of writing con.query() << "select * from stock"; while you can do: Query query = con.query(); query << "select * from stock"; Please see this thread and READ what the developers say there: (for gcc 3.3.2) http://lists.mysql.com/plusplus/3010 Good day
not a gentoo issue.