Error al linkear mysqlclient (ubuntu)

Iniciado por Destro-, 8 Noviembre 2014, 09:00 AM

0 Miembros y 1 Visitante están viendo este tema.

Destro-

Hola gente :).

Antes que nada aclaro que soy muy novato en linux :P.

Estoy tratando de compilar un .so que utiliza mysql ( mysql client 5.6 ), pero tengo un problema al linkear la librería libmysqlclient_r.a, creo que me falta algo pero no se que.

gcc -I. -I../../public -I../../public/sdk -I../../public/amtl -I../../../hlsdk -I../../../hlsdk/public -I../../../hlsdk/common -I../../../hlsdk/dlls -I../../../hlsdk/engine -I../../../hlsdk/game_shared -I../../../hlsdk/pm_shared -I../../../mysql-5.6/include -Ithread -Imysql -I../../../metamod/metamod Release/basic_sql.o Release/handles.o Release/module.o Release/threading.o Release/amxxmodule.o Release/oldcompat_sql.o Release/thread/BaseWorker.o Release/thread/ThreadWorker.o Release/thread/PosixThreads.o Release/mysql/MysqlQuery.o Release/mysql/MysqlResultSet.o Release/mysql/MysqlDatabase.o Release/mysql/MysqlDriver.o -Wl,--no-undefined ../../../mysql-5.6/lib/libmysqlclient_r.a -lpthread -L../../../mysql-5.6/lib -shared -m32 -lm -ldl -s -static-libgcc -o Release/mysql_amxx_i386.so
   ../../../mysql-5.6/lib/libmysqlclient_r.a(my_default.cc.o):(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(ssl.cpp.o):(.data.rel.ro._ZTIN5yaSSL7MessageE[typeinfo for yaSSL::Message]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(ssl.cpp.o):(.data.rel.ro._ZTIN5yaSSL12virtual_baseE[typeinfo for yaSSL::virtual_base]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(ssl.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt4HASHE[typeinfo for TaoCrypt::HASH]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(ssl.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt12virtual_baseE[typeinfo for TaoCrypt::virtual_base]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(ssl.cpp.o):(.data.rel.ro._ZTIN5yaSSL13HandShakeBaseE[typeinfo for yaSSL::HandShakeBase]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(md5.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt3MD5E[typeinfo for TaoCrypt::MD5]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(hash.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt19HASH64withTransformE[typeinfo for TaoCrypt::HASH64withTransform]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(hash.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt17HASHwithTransformE[typeinfo for TaoCrypt::HASHwithTransform]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(md4.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt3MD4E[typeinfo for TaoCrypt::MD4]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(integer.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt24MontgomeryRepresentationE[typeinfo for TaoCrypt::MontgomeryRepresentation]+0x0): more undefined references to `vtable for __cxxabiv1::__si_class_type_info' follow
   ../../../mysql-5.6/lib/libmysqlclient_r.a(my_getsystime.c.o): In function `my_getsystime':
   /export/home/pb2/build/sb_0-10831761-1384711703.69/mysql-5.6.15/mysys/my_getsystime.c:44: undefined reference to `clock_gettime'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(my_aes.cc.o):(.data.rel.ro._ZTIN8TaoCrypt9Mode_BASEE[typeinfo for TaoCrypt::Mode_BASE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(crypto_wrapper.cpp.o):(.data.rel.ro._ZTIN5yaSSL3RSAE[typeinfo for yaSSL::RSA]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(crypto_wrapper.cpp.o):(.data.rel.ro._ZTIN5yaSSL3DSSE[typeinfo for yaSSL::DSS]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(crypto_wrapper.cpp.o):(.data.rel.ro._ZTIN5yaSSL3AESE[typeinfo for yaSSL::AES]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(crypto_wrapper.cpp.o):(.data.rel.ro._ZTIN5yaSSL3RC4E[typeinfo for yaSSL::RC4]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(crypto_wrapper.cpp.o):(.data.rel.ro._ZTIN5yaSSL7DES_EDEE[typeinfo for yaSSL::DES_EDE]+0x0): more undefined references to `vtable for __cxxabiv1::__si_class_type_info' follow
   ../../../mysql-5.6/lib/libmysqlclient_r.a(des.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt3DESE[typeinfo for TaoCrypt::DES]+0x0): undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(des.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt8BasicDESE[typeinfo for TaoCrypt::BasicDES]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(aes.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt3AESE[typeinfo for TaoCrypt::AES]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(md2.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt3MD2E[typeinfo for TaoCrypt::MD2]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   ../../../mysql-5.6/lib/libmysqlclient_r.a(ripemd.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt9RIPEMD160E[typeinfo for TaoCrypt::RIPEMD160]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
   collect2: ld devolvió el estado de salida 1
   make[1]: *** [mysql] Error 1
   make[1]: se sale del directorio «/home/emanuel/amxx_mm_hlsdk/amxx/dlls/mysqlx»
   make: *** [all] Error 2
   emanuel@amxlinux:~/amxx_mm_hlsdk/amxx/dlls/mysqlx$


Proyecto:
https://github.com/alliedmodders/amxmodx/tree/master/dlls/mysqlx

En teoria era descargar los sdk, la libreria de mysql y darle a make... pero hoy ya hacen 3 días que estoy tocando de todo y no logro compilarlo.




Solucionado, tenia que linkear stdc++ y rt.
Pero tengo una duda, el .so original pesa 1.5mb, el mio 4mb o.O, esta compilado sin debug.

someRandomCode

Probablemente porque te falta hacer strip al binario (ya sea strip --strip-all o strip --strip-unneeded)

Destro-

Probe con strip y ld pero la diferencia es de unos pocos kb :\.

bueno,no importa
me conformo con que compile y funcione :P