LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-13-2003, 01:34 PM   #1
cgifalcon
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 Makefile.in aclocal.m4 build.sh config.guess config.h config.status config.sub configure install-sh libtool ltconfig ltmain.sh missing mkinstalldirs stamp* examples/Makefile.in sqlplusint/Makefile.in

libtoolize
aclocal
autoconf
automake --foreign --add-missing
./configure
make

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 'custom1.cc' || echo './'`custom1.cc; \
then mv -f ".deps/custom1.Tpo" ".deps/custom1.Po"; \
else rm -f ".deps/custom1.Tpo"; exit 1; \
fi
custom1.cc: In function `void populate_stock(stock*, const MysqlRow&) [with
sql_dummy_type dummy = sql_dummy]':
custom1.cc:10: instantiated from here
custom1.cc:10: 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.

cgifalcon

Last edited by cgifalcon; 11-13-2003 at 11:20 PM.
 
Old 11-26-2003, 07: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 custom1.cc 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, 03:19 PM   #3
cgifalcon
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 www.mysql.com 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;
mysql_init(&mysql);
connection = mysql_real_connect(&mysql,"localhost","root",
"","mysql",0,NULL,0);

if (connection == NULL) {
cout << "Error connecting to database" << mysql_error(connection) << endl;
return 1;
}
else
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;
mysql_close(connection);
return 1;
}
else
cout << "Query made...\n";

MYSQL_RES *res;
res=mysql_use_result(connection);

MYSQL_ROW row;
for(int r=0;r<mysql_field_count(connection);r++){
row=mysql_fetch_row(res);
if(row == NULL)
break;
for(t=0;t<mysql_num_fields(res);t++)
cout << row[t];
cout << endl;
}
mysql_close(connection);
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-26-2003 at 11:27 PM.
 
Old 12-10-2003, 12:45 AM   #4
cgifalcon
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
cgifalcon
 
  


Reply


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 03:00 PM
MySQL 5.0.3 - Fedora Core 3 Ryand833 Linux - Software 2 03-30-2005 07:34 AM
Fedora Core 3, MySql Server, mysql started mysql ended OkiTek Fedora 30 01-28-2005 09:15 AM
MySQL in Fedora Core 2 hokagi_ninja Linux - Newbie 8 11-10-2004 09:51 PM
mysql fedora core 2 BeatRyder Linux - Software 9 10-30-2004 10:19 AM


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

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