[Çözüldü] Libmysql sorunu

Başlatan meLeeh, 09 Ağustos 2013 - 18:32:31

« önceki - sonraki »

0 Üyeler ve 2 Ziyaretçi konuyu incelemekte.

meLeeh

Stats tutarken mysql kullanan bir bot yüklemeye çalışıyorum. Fakat bu bot için libmysql lazımmış.
Aldığım hata:
string.cpp: In member function 'void GText::String::operator=(long int)':
string.cpp:684:31: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat]
string.cpp: In member function 'void GText::String::load(FILE*)':
string.cpp:717:29: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
string.cpp:721:26: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
g++ -O3 -fPIC   -c -o tok_stream.o tok_stream.cpp
ar -rvs libgtext.a ./tok_stream_string.o ./tok.o ./tok_stream_file.o ./stream_data.o ./tok_buffer.o ./string.o ./tok_stream.o
ar: creating libgtext.a
g++ -o libgtext.so -shared -Wl,-soname=libgtext.so ./tok_stream_string.o ./tok.o ./tok_stream_file.o ./stream_data.o ./tok_buffer.o ./string.o ./tok_stream.o
make[2]: Leaving directory `/home/soldat/stats/publicstreambot/cpp_stuff/text'
cd math && make -f Makefile.linux
make[2]: Entering directory `/home/soldat/stats/publicstreambot/cpp_stuff/math'
g++ -O3 -fPIC   -c -o fintergrate.o fintergrate.cpp
g++ -O3 -fPIC   -c -o d2func.o d2func.cpp
g++ -O3 -fPIC   -c -o dfunc.o dfunc.cpp
g++ -O3 -fPIC   -c -o fitting.o fitting.cpp
g++ -O3 -fPIC   -c -o checked_ndmatrix.o checked_ndmatrix.cpp
g++ -O3 -fPIC   -c -o upper_triangular_ndmatrix.o upper_triangular_ndmatrix.cpp
g++ -O3 -fPIC   -c -o fixed_16_16.o fixed_16_16.cpp
g++ -O3 -fPIC   -c -o lower_triangular_ndmatrix.o lower_triangular_ndmatrix.cpp
g++ -O3 -fPIC   -c -o math_gexception.o math_gexception.cpp
g++ -O3 -fPIC   -c -o ndmatrix.o ndmatrix.cpp
ndmatrix.cpp: In constructor 'GMath::NDMatrixException_InvalidMatrixSize::NDMatrixException_InvalidMatrixSize(const GText::String&)':
ndmatrix.cpp:43:161: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In constructor 'GMath::NDMatrixException_InvalidIndex::NDMatrixException_InvalidIndex(const GText::String&)':
ndmatrix.cpp:44:146: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In constructor 'GMath::NDMatrixException_InvalidDim::NDMatrixException_InvalidDim(const GText::String&)':
ndmatrix.cpp:45:140: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In constructor 'GMath::NDMatrixException_NotAVector::NDMatrixException_NotAVector(const GText::String&)':
ndmatrix.cpp:46:140: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In constructor 'GMath::NDMatrixException_SingularMatrix::NDMatrixException_SingularMatrix(const GText::String&)':
ndmatrix.cpp:47:152: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In constructor 'GMath::NDMatrixException_CharacteristicError::NDMatrixException_CharacteristicError(const GText::String&)':
ndmatrix.cpp:48:167: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In member function 'virtual void GMath::NDMatrix::identity()':
ndmatrix.cpp:162:175: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In member function 'GMath::NDMatrix GMath::NDMatrix::get_row(int) const':
ndmatrix.cpp:209:98: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In member function 'GMath::NDMatrix GMath::NDMatrix::get_col(int) const':
ndmatrix.cpp:220:101: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In member function 'double& GMath::NDMatrix::operator()(int)':
ndmatrix.cpp:353:95: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ndmatrix.cpp: In member function 'const double& GMath::NDMatrix::operator()(int) const':
ndmatrix.cpp:360:95: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
g++ -O3 -fPIC   -c -o func.o func.cpp
g++ -O3 -fPIC   -c -o ode.o ode.cpp
g++ -O3 -fPIC   -c -o aprox_math.o aprox_math.cpp
ar -rvs libgmath.a ./fintergrate.o ./d2func.o ./dfunc.o ./fitting.o ./checked_ndmatrix.o ./upper_triangular_ndmatrix.o ./fixed_16_16.o ./lower_triangular_ndmatrix.o ./math_gexception.o ./ndmatrix.o ./func.o ./ode.o ./aprox_math.o
ar: creating libgmath.a
g++ -o libgmath.so -shared -Wl,-soname=libgmath.so ./fintergrate.o ./d2func.o ./dfunc.o ./fitting.o ./checked_ndmatrix.o ./upper_triangular_ndmatrix.o ./fixed_16_16.o ./lower_triangular_ndmatrix.o ./math_gexception.o ./ndmatrix.o ./func.o ./ode.o ./aprox_math.o
make[2]: Leaving directory `/home/soldat/stats/publicstreambot/cpp_stuff/math'
cd gthread && make -f Makefile.linux
make[2]: Entering directory `/home/soldat/stats/publicstreambot/cpp_stuff/gthread'
g++ -O3 -fPIC   -c -o lock.o lock.cpp
g++ -O3 -fPIC   -c -o thread.o thread.cpp
g++ -O3 -fPIC   -c -o condition.o condition.cpp
g++ -O3 -fPIC   -c -o semaphore.o semaphore.cpp
ar -rvs libgthread.a ./lock.o ./thread.o ./condition.o ./semaphore.o
ar: creating libgthread.a
g++ -o libgthread.so -shared -Wl,-soname=libgthread.so ./lock.o ./thread.o ./condition.o ./semaphore.o
make[2]: Leaving directory `/home/soldat/stats/publicstreambot/cpp_stuff/gthread'
cd gsql && make -f Makefile.linux
make[2]: Entering directory `/home/soldat/stats/publicstreambot/cpp_stuff/gsql'
g++ -O3 -fPIC   -c -o gmysql.o gmysql.cpp
g++ -O3 -fPIC   -c -o gsqlite.o gsqlite.cpp
gsqlite.cpp: In static member function 'static void GSQL::GSQLite::init_dl()':
gsqlite.cpp:68:33: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'void*' [-Wformat]
gsqlite.cpp: In member function 'virtual void GSQL::GSQLite::select_databse(const GText::String&)':
gsqlite.cpp:124:70: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
gsqlite.cpp: In member function 'virtual bool GSQL::GSQLite::does_table_exist(const GText::String&)':
gsqlite.cpp:167:78: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
gsqlite.cpp: In member function 'virtual void GSQL::GSQLite::add_column_to_table(const GText::String&, const GText::String&, const GText::String&)':
gsqlite.cpp:206:43: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
gsqlite.cpp: In member function 'virtual void GSQL::GSQLite::delete_column_from_table(const GText::String&, const GText::String&)':
gsqlite.cpp:246:43: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
g++ -O3 -fPIC   -c -o gsql.o gsql.cpp
ar -rvs libgsql.a ./gmysql.o ./gsqlite.o ./gsql.o
ar: creating libgsql.a
g++ -o libgsql.so -shared -Wl,-soname=libgsql.so ./gmysql.o ./gsqlite.o ./gsql.o
make[2]: Leaving directory `/home/soldat/stats/publicstreambot/cpp_stuff/gsql'
cd fsystem && make -f Makefile.linux
make[2]: Entering directory `/home/soldat/stats/publicstreambot/cpp_stuff/fsystem'
g++ -O3 -fPIC   -c -o lfile.o lfile.cpp
g++ -O3 -fPIC   -c -o fexception.o fexception.cpp
g++ -O3 -fPIC   -c -o regular_directory.o regular_directory.cpp
g++ -O3 -fPIC   -c -o memwrite_file.o memwrite_file.cpp
g++ -O3 -fPIC   -c -o regular_file.o regular_file.cpp
g++ -O3 -fPIC   -c -o stdout_file.o stdout_file.cpp
g++ -O3 -fPIC   -c -o stat.o stat.cpp
g++ -O3 -fPIC   -c -o stdin_file.o stdin_file.cpp
g++ -O3 -fPIC   -c -o directory.o directory.cpp
ar -rvs libgfsystem.a ./lfile.o ./fexception.o ./regular_directory.o ./memwrite_file.o ./regular_file.o ./stdout_file.o ./stat.o ./stdin_file.o ./directory.o
ar: creating libgfsystem.a
g++ -o libgfsystem.so -shared -Wl,-soname=libgfsystem.so ./lfile.o ./fexception.o ./regular_directory.o ./memwrite_file.o ./regular_file.o ./stdout_file.o ./stat.o ./stdin_file.o ./directory.o
make[2]: Leaving directory `/home/soldat/stats/publicstreambot/cpp_stuff/fsystem'
ar -rs  libgall.a containers/*.o  text/*.o  math/*.o  gthread/*.o  gsql/*.o  fsystem/*.o  ./*.o
g++ -o libgall.so  -shared -Wl,-soname=libgall.so containers/*.o  text/*.o  math/*.o  gthread/*.o  gsql/*.o  fsystem/*.o  ./*.o
make[1]: Leaving directory `/home/soldat/stats/publicstreambot/cpp_stuff'
g++ -g -lpthread -L/usr/lib/mysql/ -lmysqlclient -lz streambot.o soldatadmin.o irc.o statslog.o ./cpp_stuff/libgall.a -o streambot
streambot.o: In function `createthreads()':
streambot.cpp:(.text+0x33b2): undefined reference to `pthread_create'
streambot.o: In function `jointhreads()':
streambot.cpp:(.text+0x342e): undefined reference to `pthread_join'
streambot.o: In function `runSpam()':
streambot.cpp:(.text+0x3483): undefined reference to `pthread_create'
streambot.o: In function `runConfig()':
streambot.cpp:(.text+0x34b3): undefined reference to `pthread_create'
streambot.o: In function `readcfg(GText::String)':
streambot.cpp:(.text+0x40ba): undefined reference to `pthread_create'
statslog.o: In function `initStats()':
statslog.cpp:(.text+0x26a3): undefined reference to `pthread_create'
irc.o: In function `IRC::outThread(void*)':
irc.cpp:(.text+0x234): undefined reference to `sem_wait'
irc.o: In function `IRC::~IRC()':
irc.cpp:(.text+0xd51): undefined reference to `sem_destroy'
irc.cpp:(.text+0xd67): undefined reference to `pthread_join'
irc.o: In function `IRC::IRC(bool, int)':
irc.cpp:(.text+0x11e8): undefined reference to `sem_init'
irc.cpp:(.text+0x120a): undefined reference to `pthread_create'
irc.o: In function `IRC::IRC()':
irc.cpp:(.text+0x15b9): undefined reference to `sem_init'
irc.cpp:(.text+0x15db): undefined reference to `pthread_create'
irc.o: In function `IRC::sendMsg(char*)':
irc.cpp:(.text+0x172b): undefined reference to `sem_post'
./cpp_stuff/libgall.a(gmysql.o): In function `GSQL::GMySQL::does_table_exist(GText::String const&)':
gmysql.cpp:(.text+0xc08): undefined reference to `mysql_list_tables'
gmysql.cpp:(.text+0xc16): undefined reference to `mysql_num_fields'
gmysql.cpp:(.text+0xc56): undefined reference to `mysql_fetch_row'
gmysql.cpp:(.text+0xc62): undefined reference to `mysql_free_result'
gmysql.cpp:(.text+0xc9c): undefined reference to `mysql_error'
./cpp_stuff/libgall.a(gmysql.o): In function `GSQL::GMySQL::query(char const*, GSQL::GSQL::QueryResult*)':
gmysql.cpp:(.text+0xe17): undefined reference to `mysql_query'
gmysql.cpp:(.text+0xe38): undefined reference to `mysql_store_result'
gmysql.cpp:(.text+0xe4c): undefined reference to `mysql_num_fields'
gmysql.cpp:(.text+0xe5e): undefined reference to `mysql_fetch_fields'
gmysql.cpp:(.text+0xe71): undefined reference to `mysql_fetch_lengths'
gmysql.cpp:(.text+0xe9a): undefined reference to `mysql_fetch_row'
gmysql.cpp:(.text+0xeb0): undefined reference to `mysql_free_result'
gmysql.cpp:(.text+0xed7): undefined reference to `mysql_use_result'
gmysql.cpp:(.text+0xeec): undefined reference to `mysql_fetch_row'
gmysql.cpp:(.text+0xefa): undefined reference to `mysql_field_count'
gmysql.cpp:(.text+0xf16): undefined reference to `mysql_error'
gmysql.cpp:(.text+0xfd5): undefined reference to `mysql_error'
./cpp_stuff/libgall.a(gmysql.o): In function `GSQL::GMySQL::select_databse(GText::String const&)':
gmysql.cpp:(.text+0x11d0): undefined reference to `mysql_select_db'
gmysql.cpp:(.text+0x1223): undefined reference to `mysql_error'
./cpp_stuff/libgall.a(gmysql.o): In function `GSQL::GMySQL::does_database_exist(GText::String const&)':
gmysql.cpp:(.text+0x1398): undefined reference to `mysql_list_dbs'
gmysql.cpp:(.text+0x13a6): undefined reference to `mysql_num_fields'
gmysql.cpp:(.text+0x13e6): undefined reference to `mysql_fetch_row'
gmysql.cpp:(.text+0x13f2): undefined reference to `mysql_free_result'
gmysql.cpp:(.text+0x142c): undefined reference to `mysql_error'
./cpp_stuff/libgall.a(gmysql.o): In function `GSQL::GMySQL::~GMySQL()':
gmysql.cpp:(.text+0x1585): undefined reference to `mysql_close'
./cpp_stuff/libgall.a(gmysql.o): In function `GSQL::GMySQL::GMySQL(GText::String const&, GText::String const&, GText::String const&, int, bool, bool, GText::String const&, GText::String const&, GText::String const&, GText::String const&, GText::String const&)':
gmysql.cpp:(.text+0x176b): undefined reference to `mysql_init'
gmysql.cpp:(.text+0x17fa): undefined reference to `mysql_real_connect'
gmysql.cpp:(.text+0x18cd): undefined reference to `mysql_ssl_set'
gmysql.cpp:(.text+0x18ea): undefined reference to `mysql_error'
./cpp_stuff/libgall.a(gmysql.o): In function `GSQL::GMySQL::GMySQL(GText::String const&, GText::String const&, GText::String const&, int, bool, bool)':
gmysql.cpp:(.text+0x1b43): undefined reference to `mysql_init'
gmysql.cpp:(.text+0x1bcb): undefined reference to `mysql_real_connect'
gmysql.cpp:(.text+0x1c85): undefined reference to `mysql_error'
collect2: ld returned 1 exit status
make: *** [streambot] Error 1
root@server:/home/soldat/stats/publicstreambot#


Libmysql yüklemeye çalıştığımda:
root@server:~# apt-get install libmysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libmysql
root@server:~#


Ubuntu sürümüm: 12.10

furkankalkan

Tam adı o olmayabilir paketin o yüzden synapticten de bir bakın derim ben.
Lover
twitter.com/furkan_kalkan1

meLeeh

Alıntı yapılan: dewilmanTam adı o olmayabilir paketin o yüzden synapticten de bir bakın derim ben.
Yüklü gözüküyor.

ersinkandemir

Hangi paketi kuruyorsanız bir de sonuna -dev ekler misiniz?
Where there's a shell, there's a way.



meLeeh

Buyurun;
root@soldatarena:~# apt-get install libmysql-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libmysql-dev
root@soldatarena:~# apt-get install libmysqlclient-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmysqlclient-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
root@soldatarena:~#

ersinkandemir

sudo apt-get install libmysql++-dev

Bu paketi dener misiniz?
Where there's a shell, there's a way.



meLeeh

Buyurun;
root@soldatarena:~# sudo apt-get install libmysql++-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmysql++-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
root@soldatarena:~#

heartsmagic

Sorunun libmysql ile ilgili bir sorun olduğuna nasıl kanaat getirdik?
İlk gördüğüm hata şu sanki:
streambot.o: In function `createthreads()':
streambot.cpp:(.text+0x33b2): undefined reference to `pthread_create'


Derlemeyi etkiler mi? Bilemiyorum. Fakat sorun paket kurma, kaldırmayla çözülecek bir şey değil muhtemelen:
http://stackoverflow.com/questions/1662909/undefined-reference-to-pthread-create-in-linux-c-programming

Kısacası ne derliyorsun ve bunun için nereyi takip ediyorsun?
Hayattan çıkarı olmayanların, ölümden de çıkarı olmayacaktır.
Hayatlarıyla yanlış olanların ölümleriyle doğru olmalarına imkân var mıdır?


Böylece yalan, dünyanın düzenine dönüştürülüyor.

meLeeh

#8
Botu yazan kişi söyledi hatanın libmysql de olduğunu.

Aynı botu Debian'da açmaya çalışınca açılıyor, Ubuntu'da hata veriyor.



Sorunu çözdüm. Debian'a g++ kurmaya çalışınca 4.4 sürümünü yüklüyormuş. Ubuntu'ya g++ yüklemeyi denediğimde 4.6 yüklüyormuş. Ubuntu'ya da g++'yı 4.4 sürümüyle birlikte yükleyince çalıştı.