Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-13-2003, 02:34 PM   #1
LQ Newbie
Registered: Oct 2003
Posts: 9

Rep: Reputation: 0
Fedora Core 1 mysql++ compilation error

Hello linux gurus,
I installed Fedora Core 1, gcc-3.3.2 and use these commands

tar xzf mysql++-1.7.9.tar.gz
patch -p1 -d mysql++-1.7.9 < patch_gcc_3.3

rm aclocal.m4 config.guess config.h config.status config.sub configure install-sh libtool ltconfig missing mkinstalldirs stamp* examples/ sqlplusint/

automake --foreign --add-missing

And what was after some time happened.

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../sqlplusint -I../sqlplusint -I/usr/include/mysql -g -O2 -MT custom1.o -MD -MP -MF ".deps/custom1.Tpo" \
-c -o custom1.o `test -f '' || echo './'`; \
then mv -f ".deps/custom1.Tpo" ".deps/custom1.Po"; \
else rm -f ".deps/custom1.Tpo"; exit 1; \
fi In function `void populate_stock(stock*, const MysqlRow&) [with
sql_dummy_type dummy = sql_dummy]': instantiated from here error: ambiguous overload for 'operator=' in 's->stock::item =
MysqlRow:perator[](int) const(0)'
/usr/include/c++/3.3.2/bits/basic_string.h:361: error: candidates are:
std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT,
_Traits, _Alloc>:perator=(const _CharT*) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/include/c++/3.3.2/bits/basic_string.h:364: error:
std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT,
_Traits, _Alloc>:perator=(_CharT) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]
make[2]: *** [custom1.o] Error 1
make[2]: Leaving directory `/usr/src/redhat/SOURCES/mysql++-1.7.9/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/redhat/SOURCES/mysql++-1.7.9'
make: *** [all] Error 2

The same thing I made on the RedHat 9, only with apropriate patches and all was O.K.
And now the compilation ends with error.

Thanks for help.


Last edited by cgifalcon; 11-14-2003 at 12:20 AM.
Old 11-26-2003, 08:45 AM   #2
Simon Dale
LQ Newbie
Registered: Nov 2003
Posts: 1

Rep: Reputation: 0
ive been trying to do the same... had no luck at exactly the same point as you.

looking at the error, it is only the examples which are failing to build when you run make so if you can live without them, you can easily get it to compile to completion.

i did this by editing the file in the examples subdirectory and making its content:

int main()
return 0;

that way it will compile ok. then i copied this over the files custom[2-4].cc since these had the same problem.

then rerun the make command and it should all complete ok.

after that:
make install
Old 11-26-2003, 04:19 PM   #3
LQ Newbie
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Hi Simon,
I have already done the same and also was able to compile mySql++. But when I tried to compile my program which I could compile under Red Hat 9, there were errors under Fedora Core 1. So I decided to write to Sinisa Milivojevic (private mail the 19 th. of the November) and his reply was then he tries to repare mySql++ and it lasts at least month. If you look at you can find mail lists and there are the same problems. Sinisa answers to someone the same as to me.

Best regards cgifalcon

P.S. In meantime I tried to call C functions for communication with mySql from my C++ programs and all is OK. Here is example :

#include <mysql/mysql.h>
#include <iostream>

using namespace std;

int main(){

MYSQL *connection, mysql;
connection = mysql_real_connect(&mysql,"localhost","root",

if (connection == NULL) {
cout << "Error connecting to database" << mysql_error(connection) << endl;
return 1;
cout << "Connected...\n";

char *query ="select * from user";

int t;
t=mysql_real_query(connection,query,(unsigned int) strlen(query));

if (t != 0) {
cout << "Error making query" << mysql_error(connection) << endl;
return 1;
cout << "Query made...\n";


for(int r=0;r<mysql_field_count(connection);r++){
if(row == NULL)
cout << row[t];
cout << endl;
return 0;

And you can compile it in this way:

g++ -o test02 -I/usr/include/mysql test02.cpp -L/usr/lib/mysql -lmysqlclient

Last edited by cgifalcon; 11-27-2003 at 12:27 AM.
Old 12-10-2003, 01:45 AM   #4
LQ Newbie
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Hi Simon,

after some time I returned to the problem with mySql++ under Fedora Core 1. I repaired my program and now is all OK.

Best regards


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql in fedora core 2 jkmartha Linux - Software 1 05-02-2005 04:00 PM
MySQL 5.0.3 - Fedora Core 3 Ryand833 Linux - Software 2 03-30-2005 08:34 AM
Fedora Core 3, MySql Server, mysql started mysql ended OkiTek Fedora 30 01-28-2005 10:15 AM
MySQL in Fedora Core 2 hokagi_ninja Linux - Newbie 8 11-10-2004 10:51 PM
mysql fedora core 2 BeatRyder Linux - Software 9 10-30-2004 11:19 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration