Форум русскоязычного сообщества Ubuntu


Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

Автор Тема: Ubuntu 12.04 и линковщик MySql проблема  (Прочитано 3270 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн utooz

  • Автор темы
  • Новичок
  • *
  • Сообщений: 16
    • Просмотр профиля
Ubuntu 12.04 и линковщик MySql проблема
« : 11 Декабря 2012, 21:41:08 »
Имеется прога написанная в NetBeans где в настройках компилятора указанно -L/usr/lib/mysql -lmysqlclient. Эта прога замечательно компилилась на 8,10,11, на десктопах и серверах но на 12.04 не компилится нигде.
Выдается блок содержащий "undefined reference to `mysql_init'" и прочие "undefined reference" связанные м MySql. libmysql-client и mysqlclient поставлены из репа.

Что делать? Что не так?

Оффлайн hippi90

  • Активист
  • *
  • Сообщений: 433
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #1 : 11 Декабря 2012, 21:52:50 »
Могу ошибаться, но поскольку родительский Debian теперь multi-arch, то многие библиотеки были перетасованы, и libmysqlclient.so теперь лежит в /usr/lib/i386-linux-gnu/, а в /usr/lib на нее должен быть симлинк.

Оффлайн utooz

  • Автор темы
  • Новичок
  • *
  • Сообщений: 16
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #2 : 12 Декабря 2012, 10:16:42 »
К сожалению, визуально ничего не поменялось. Все находится в прежних местах. Эта проблема повторилась и на Mint на основе Ubuntu 12.04.
Только из за этого не могу перевести серверы с 10.04 на 12.04.

Оффлайн Yurror

  • Старожил
  • *
  • Сообщений: 1966
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #3 : 12 Декабря 2012, 13:58:42 »
ну вариантов два
1) декорация имён, проверьте extern "C" {} там нигде поставить не надо?
2) библиотеки таки не от той архитектуры, проверьте всё еще раз

Оффлайн utooz

  • Автор темы
  • Новичок
  • *
  • Сообщений: 16
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #4 : 12 Декабря 2012, 19:23:50 »
1) декорация имён, проверьте extern "C" {} там нигде поставить не надо?
??????
Библиотеки из репов ставились.

Оффлайн Yurror

  • Старожил
  • *
  • Сообщений: 1966
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #5 : 13 Декабря 2012, 05:52:55 »
utooz,
И как декорация имён идентификаторов в С++ коррелирует с репозитариями убунты? =)

Короче, я не поленился погуглил. http://www.cyberciti.biz/tips/linux-unix-connect-mysql-c-api-program.html

Итак нам понадобится
sudo apt-get install build-essential libmysqlclient-dev
(Нажмите, чтобы показать/скрыть)


Ну и собираем его без особых проблем
Код: (sh) [Выделить]
gcc -Wall -Wextra $(mysql_config --cflags) mytest.c $(mysql_config --libs) -o mytest

Оффлайн utooz

  • Автор темы
  • Новичок
  • *
  • Сообщений: 16
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #6 : 14 Декабря 2012, 10:12:36 »
sudo apt-get install build-essential libmysqlclient-devДа поставлено все это изначально.
Ставлю Ubuntu server 11.04 делаю оптом apt-get
-y install libncurses5-dev openssl libssl-dev zlib1g zlib1g-dev build-essential php5 php5-cli php5-mysql php5-gd php-pear apache2 curl sox bison flex cpp g++ gcc make libxml2 libxml2-dev libtiff4 libtiff4-dev lame perl-modules libaudiofile-dev subversion fail2ban chkconfig iptables autoconf sysstat dstat linux-headers-$(uname -r) linux-image-$(uname -r) mysql-server libmysqlclient16 libmysqlclient-devНет проблем - все компилится и на 32, и на 64, и на АМД!!!!
Ставлю Ubuntu server 12.04 делаю оптом apt-get
-y install libncurses5-dev openssl libssl-dev zlib1g zlib1g-dev build-essential php5 php5-cli php5-mysql php5-gd php-pear apache2 curl sox bison flex cpp g++ gcc make libxml2 libxml2-dev libtiff4 libtiff4-dev lame perl-modules libaudiofile-dev subversion fail2ban chkconfig iptables autoconf sysstat dstat linux-headers-$(uname -r) linux-image-$(uname -r) mysql-server libmysqlclient18 libmysqlclient-devНе компилится!!!!!!!!!!!!!
Изменилось только libmysqlclient с 16 на 18 !!!

В чем прикол ?????

Та же хрень с десктопной версией. На 11.04 проект NetBeans компилится, запускается, а 12.04 - фигос, валит ошибки!
« Последнее редактирование: 14 Декабря 2012, 10:26:36 от utooz »

Оффлайн Yurror

  • Старожил
  • *
  • Сообщений: 1966
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #7 : 17 Декабря 2012, 12:26:37 »
Флаги сборки и линковки в студию

gcc -Wall -Wextra $(mysql_config --cflags) mytest.c $(mysql_config --libs) -o mytestВот так вот если указывать тоже нифига не работает?

Да ты не кипятись а попробуй. Я уверен что тут просто неумение читать с монитора. Там всё написано тебе просто тупо лень прочитать и понять.

Оффлайн utooz

  • Автор темы
  • Новичок
  • *
  • Сообщений: 16
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #8 : 22 Декабря 2012, 16:22:39 »
Флаги сборки и линковки в студию

"/usr/bin/make" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Вход в каталог `/home/devel/own/DEVELOPMENT-IDE/NetBeans/C/Call-Taxi_Phone_SFL2'
"/usr/bin/make"  -f nbproject/Makefile-Release.mk /usr/share/call-taxi/call-taxi
make[2]: Вход в каталог `/home/devel/own/DEVELOPMENT-IDE/NetBeans/C/Call-Taxi_Phone_SFL2'
mkdir -p /usr/share/call-taxi
gcc -L/usr/lib/mysql -lmysqlclient    -o /usr/share/call-taxi/call-taxi build/Release/GNU-Linux-x86/SFL/ast/check-device-channel.o build/Release/GNU-Linux-x86/CLIENT/client.o build/Release/GNU-Linux-x86/SFL/node/sflnode.o build/Release/GNU-Linux-x86/SFL/cagi/cagi.o build/Release/GNU-Linux-x86/gsmballance.o build/Release/GNU-Linux-x86/SFL/ast/ballans.o build/Release/GNU-Linux-x86/addclientdb.o build/Release/GNU-Linux-x86/client2blacklist.o build/Release/GNU-Linux-x86/who-is-who.o build/Release/GNU-Linux-x86/SFL/dir/sfldir.o build/Release/GNU-Linux-x86/SFL/console/sflcons.o build/Release/GNU-Linux-x86/SFL/cagi/astercagi.o build/Release/GNU-Linux-x86/opsossep.o build/Release/GNU-Linux-x86/SFL/dbinterface/sfldbio.o build/Release/GNU-Linux-x86/SFL/symbol/sflsymb.o build/Release/GNU-Linux-x86/SFL/evvironm/sflenv.o build/Release/GNU-Linux-x86/getidsinfo.o build/Release/GNU-Linux-x86/SFL/uid_gid/sfluid.o build/Release/GNU-Linux-x86/SERVER/servconf.o build/Release/GNU-Linux-x86/getdeviceinfo.o build/Release/GNU-Linux-x86/SFL/date/sfldate.o build/Release/GNU-Linux-x86/SFL/socket/sflsock.o build/Release/GNU-Linux-x86/getdiskinfo.o build/Release/GNU-Linux-x86/SFL/string/sflstr.o build/Release/GNU-Linux-x86/SFL/http/sflhttp.o build/Release/GNU-Linux-x86/call-taxi.o build/Release/GNU-Linux-x86/SFL/mysqlsfl/sflmysql.o build/Release/GNU-Linux-x86/SFL/memory/sflmem.o build/Release/GNU-Linux-x86/SFL/token/sfltok.o build/Release/GNU-Linux-x86/SFL/proc_control/sflproc.o build/Release/GNU-Linux-x86/SFL/tracing/sfltron.o build/Release/GNU-Linux-x86/SERVER/server.o build/Release/GNU-Linux-x86/SFL/citycodeua/citycode.o build/Release/GNU-Linux-x86/CLIENT/clientconf.o build/Release/GNU-Linux-x86/SFL/find/sflfind.o build/Release/GNU-Linux-x86/logcallback.o build/Release/GNU-Linux-x86/SFL/cagi/fastcagi.o build/Release/GNU-Linux-x86/SFL/print/sflprint.o build/Release/GNU-Linux-x86/chblacklistmain.o build/Release/GNU-Linux-x86/CLIENT/addclient.o build/Release/GNU-Linux-x86/SFL/conv/sflconv.o build/Release/GNU-Linux-x86/SFL/file/sflfile.o build/Release/GNU-Linux-x86/SERVER/addserver.o build/Release/GNU-Linux-x86/SFL/ast/get-device-info.o build/Release/GNU-Linux-x86/anonimcidreject.o build/Release/GNU-Linux-x86/errormesagelog.o build/Release/GNU-Linux-x86/SFL/linked_list/sfllist.o 
build/Release/GNU-Linux-x86/gsmballance.o: In function `gsmballance':
gsmballance.c:(.text+0x118): undefined reference to `mysql_free_result'
gsmballance.c:(.text+0x126): undefined reference to `mysql_close'
gsmballance.c:(.text+0x15a): undefined reference to `mysql_init'
gsmballance.c:(.text+0x1a0): undefined reference to `mysql_real_connect'
gsmballance.c:(.text+0x1b6): undefined reference to `mysql_thread_id'
gsmballance.c:(.text+0x1c4): undefined reference to `mysql_character_set_name'
gsmballance.c:(.text+0x1e1): undefined reference to `mysql_set_character_set'
gsmballance.c:(.text+0x2e2): undefined reference to `mysql_error'
build/Release/GNU-Linux-x86/addclientdb.o: In function `addclientdb':
addclientdb.c:(.text+0x9e): undefined reference to `mysql_init'
addclientdb.c:(.text+0xde): undefined reference to `mysql_real_connect'
addclientdb.c:(.text+0xfa): undefined reference to `mysql_thread_id'
addclientdb.c:(.text+0x102): undefined reference to `mysql_character_set_name'
addclientdb.c:(.text+0x11f): undefined reference to `mysql_set_character_set'
addclientdb.c:(.text+0x1a2): undefined reference to `mysql_query'
addclientdb.c:(.text+0x1d5): undefined reference to `mysql_change_user'
addclientdb.c:(.text+0x2e2): undefined reference to `mysql_query'
addclientdb.c:(.text+0x35c): undefined reference to `mysql_close'
addclientdb.c:(.text+0x38c): undefined reference to `mysql_error'
addclientdb.c:(.text+0x40c): undefined reference to `mysql_error'
build/Release/GNU-Linux-x86/client2blacklist.o: In function `client2blacklist':
client2blacklist.c:(.text+0x92): undefined reference to `mysql_init'
client2blacklist.c:(.text+0xd2): undefined reference to `mysql_real_connect'
client2blacklist.c:(.text+0xe2): undefined reference to `mysql_thread_id'
client2blacklist.c:(.text+0xea): undefined reference to `mysql_character_set_name'
client2blacklist.c:(.text+0x101): undefined reference to `mysql_set_character_set'
client2blacklist.c:(.text+0x1a2): undefined reference to `mysql_free_result'
client2blacklist.c:(.text+0x1aa): undefined reference to `mysql_close'
client2blacklist.c:(.text+0x1d4): undefined reference to `mysql_error'
build/Release/GNU-Linux-x86/who-is-who.o: In function `who_is_who':
who-is-who.c:(.text+0x96): undefined reference to `mysql_init'
who-is-who.c:(.text+0xd8): undefined reference to `mysql_real_connect'
who-is-who.c:(.text+0xe8): undefined reference to `mysql_thread_id'
who-is-who.c:(.text+0xf0): undefined reference to `mysql_character_set_name'
who-is-who.c:(.text+0x107): undefined reference to `mysql_set_character_set'
who-is-who.c:(.text+0x1aa): undefined reference to `mysql_query'
who-is-who.c:(.text+0x1ba): undefined reference to `mysql_store_result'
who-is-who.c:(.text+0x1c4): undefined reference to `mysql_num_fields'
who-is-who.c:(.text+0x1d2): undefined reference to `mysql_num_rows'
who-is-who.c:(.text+0x336): undefined reference to `mysql_query'
who-is-who.c:(.text+0x34e): undefined reference to `mysql_store_result'
who-is-who.c:(.text+0x358): undefined reference to `mysql_num_fields'
who-is-who.c:(.text+0x37e): undefined reference to `mysql_fetch_row'
who-is-who.c:(.text+0x390): undefined reference to `mysql_fetch_lengths'
who-is-who.c:(.text+0x41b): undefined reference to `mysql_query'
who-is-who.c:(.text+0x4b4): undefined reference to `mysql_free_result'
who-is-who.c:(.text+0x4bc): undefined reference to `mysql_close'
who-is-who.c:(.text+0x559): undefined reference to `mysql_query'
who-is-who.c:(.text+0x5e4): undefined reference to `mysql_fetch_row'
who-is-who.c:(.text+0x5f2): undefined reference to `mysql_fetch_lengths'
who-is-who.c:(.text+0x651): undefined reference to `mysql_fetch_row'
who-is-who.c:(.text+0x74c): undefined reference to `mysql_free_result'
who-is-who.c:(.text+0x754): undefined reference to `mysql_store_result'
who-is-who.c:(.text+0x75e): undefined reference to `mysql_num_fields'
who-is-who.c:(.text+0x76c): undefined reference to `mysql_num_rows'
who-is-who.c:(.text+0x7b3): undefined reference to `mysql_query'
who-is-who.c:(.text+0x7fc): undefined reference to `mysql_error'
who-is-who.c:(.text+0x9ba): undefined reference to `mysql_query'
who-is-who.c:(.text+0x9d2): undefined reference to `mysql_store_result'
who-is-who.c:(.text+0x9dc): undefined reference to `mysql_num_fields'
who-is-who.c:(.text+0x9f4): undefined reference to `mysql_fetch_row'
who-is-who.c:(.text+0xa10): undefined reference to `mysql_fetch_lengths'
who-is-who.c:(.text+0xaa1): undefined reference to `mysql_query'
who-is-who.c:(.text+0xaf2): undefined reference to `mysql_fetch_row'
who-is-who.c:(.text+0xb0a): undefined reference to `mysql_fetch_lengths'
who-is-who.c:(.text+0xb94): undefined reference to `mysql_fetch_row'
who-is-who.c:(.text+0xba2): undefined reference to `mysql_fetch_lengths'
build/Release/GNU-Linux-x86/getidsinfo.o: In function `getidsinfo':
getidsinfo.c:(.text+0x8a): undefined reference to `mysql_init'
getidsinfo.c:(.text+0xca): undefined reference to `mysql_real_connect'
getidsinfo.c:(.text+0xda): undefined reference to `mysql_thread_id'
getidsinfo.c:(.text+0xe2): undefined reference to `mysql_character_set_name'
getidsinfo.c:(.text+0xf9): undefined reference to `mysql_set_character_set'
getidsinfo.c:(.text+0x13e): undefined reference to `mysql_query'
getidsinfo.c:(.text+0x14e): undefined reference to `mysql_store_result'
getidsinfo.c:(.text+0x15c): undefined reference to `mysql_num_fields'
getidsinfo.c:(.text+0x170): undefined reference to `mysql_num_rows'
getidsinfo.c:(.text+0x1ec): undefined reference to `mysql_free_result'
getidsinfo.c:(.text+0x1f4): undefined reference to `mysql_close'
getidsinfo.c:(.text+0x272): undefined reference to `mysql_fetch_row'
getidsinfo.c:(.text+0x290): undefined reference to `mysql_fetch_lengths'
getidsinfo.c:(.text+0x534): undefined reference to `mysql_error'
build/Release/GNU-Linux-x86/getdeviceinfo.o: In function `getdeviceinfo':
getdeviceinfo.c:(.text+0xa4): undefined reference to `mysql_init'
getdeviceinfo.c:(.text+0xe4): undefined reference to `mysql_real_connect'
getdeviceinfo.c:(.text+0xf4): undefined reference to `mysql_thread_id'
getdeviceinfo.c:(.text+0xfc): undefined reference to `mysql_character_set_name'
getdeviceinfo.c:(.text+0x113): undefined reference to `mysql_set_character_set'
getdeviceinfo.c:(.text+0x155): undefined reference to `mysql_query'
getdeviceinfo.c:(.text+0x199): undefined reference to `mysql_free_result'
getdeviceinfo.c:(.text+0x1a1): undefined reference to `mysql_close'
getdeviceinfo.c:(.text+0x1cc): undefined reference to `mysql_store_result'
getdeviceinfo.c:(.text+0x1d6): undefined reference to `mysql_num_fields'
getdeviceinfo.c:(.text+0x1e4): undefined reference to `mysql_num_rows'
getdeviceinfo.c:(.text+0x2da): undefined reference to `mysql_fetch_row'
getdeviceinfo.c:(.text+0x2ee): undefined reference to `mysql_fetch_lengths'
getdeviceinfo.c:(.text+0x35a): undefined reference to `mysql_free_result'
getdeviceinfo.c:(.text+0x402): undefined reference to `mysql_query'
getdeviceinfo.c:(.text+0x412): undefined reference to `mysql_store_result'
getdeviceinfo.c:(.text+0x41c): undefined reference to `mysql_num_fields'
getdeviceinfo.c:(.text+0x42a): undefined reference to `mysql_num_rows'
getdeviceinfo.c:(.text+0x44a): undefined reference to `mysql_fetch_row'
getdeviceinfo.c:(.text+0x462): undefined reference to `mysql_fetch_lengths'
getdeviceinfo.c:(.text+0x56a): undefined reference to `mysql_query'
getdeviceinfo.c:(.text+0x70c): undefined reference to `mysql_store_result'
getdeviceinfo.c:(.text+0x716): undefined reference to `mysql_num_fields'
getdeviceinfo.c:(.text+0x724): undefined reference to `mysql_num_rows'
getdeviceinfo.c:(.text+0x752): undefined reference to `mysql_fetch_row'
getdeviceinfo.c:(.text+0x766): undefined reference to `mysql_fetch_lengths'
build/Release/GNU-Linux-x86/SFL/mysqlsfl/sflmysql.o: In function `dbio_mysql_connect':
sflmysql.c:(.text+0x5a): undefined reference to `mysql_init'
sflmysql.c:(.text+0xa2): undefined reference to `mysql_real_connect'
sflmysql.c:(.text+0xb2): undefined reference to `mysql_character_set_name'
sflmysql.c:(.text+0xcc): undefined reference to `mysql_set_character_set'
sflmysql.c:(.text+0x1ee): undefined reference to `mysql_select_db'
sflmysql.c:(.text+0x223): undefined reference to `mysql_close'
sflmysql.c:(.text+0x2d5): undefined reference to `mysql_error'
build/Release/GNU-Linux-x86/SFL/mysqlsfl/sflmysql.o: In function `dbio_mysql_disconnect':
sflmysql.c:(.text+0x32c): undefined reference to `mysql_close'
build/Release/GNU-Linux-x86/SFL/mysqlsfl/sflmysql.o: In function `alloc_mysql_handle':
sflmysql.c:(.text+0x4d2): undefined reference to `mysql_close'
build/Release/GNU-Linux-x86/chblacklistmain.o: In function `chblacklistmain':
chblacklistmain.c:(.text+0x7c): undefined reference to `mysql_init'
chblacklistmain.c:(.text+0xbc): undefined reference to `mysql_real_connect'
chblacklistmain.c:(.text+0xcc): undefined reference to `mysql_thread_id'
chblacklistmain.c:(.text+0xd4): undefined reference to `mysql_character_set_name'
chblacklistmain.c:(.text+0xeb): undefined reference to `mysql_set_character_set'
chblacklistmain.c:(.text+0x130): undefined reference to `mysql_query'
chblacklistmain.c:(.text+0x17f): undefined reference to `mysql_free_result'
chblacklistmain.c:(.text+0x187): undefined reference to `mysql_close'
chblacklistmain.c:(.text+0x1b4): undefined reference to `mysql_store_result'
chblacklistmain.c:(.text+0x1be): undefined reference to `mysql_num_fields'
chblacklistmain.c:(.text+0x1cc): undefined reference to `mysql_num_rows'
chblacklistmain.c:(.text+0x20a): undefined reference to `mysql_fetch_row'
chblacklistmain.c:(.text+0x222): undefined reference to `mysql_fetch_lengths'
chblacklistmain.c:(.text+0x454): undefined reference to `mysql_error'
build/Release/GNU-Linux-x86/CLIENT/addclient.o: In function `nwc_connect':
addclient.c:(.text+0x828): undefined reference to `pthread_create'
build/Release/GNU-Linux-x86/SERVER/addserver.o: In function `enable_request_mode':
addserver.c:(.text+0x1417): undefined reference to `pthread_create'
addserver.c:(.text+0x143a): undefined reference to `pthread_create'
addserver.c:(.text+0x146f): undefined reference to `pthread_create'
addserver.c:(.text+0x1492): undefined reference to `pthread_create'
build/Release/GNU-Linux-x86/SERVER/addserver.o:addserver.c:(.text+0x156f): more undefined references to `pthread_create' follow
build/Release/GNU-Linux-x86/anonimcidreject.o: In function `getidsname':
anonimcidreject.c:(.text+0x32): undefined reference to `mysql_init'
anonimcidreject.c:(.text+0x72): undefined reference to `mysql_real_connect'
anonimcidreject.c:(.text+0x82): undefined reference to `mysql_thread_id'
anonimcidreject.c:(.text+0x8a): undefined reference to `mysql_character_set_name'
anonimcidreject.c:(.text+0xa1): undefined reference to `mysql_set_character_set'
anonimcidreject.c:(.text+0x101): undefined reference to `mysql_query'
anonimcidreject.c:(.text+0x111): undefined reference to `mysql_store_result'
anonimcidreject.c:(.text+0x11b): undefined reference to `mysql_num_fields'
anonimcidreject.c:(.text+0x125): undefined reference to `mysql_num_rows'
anonimcidreject.c:(.text+0x15c): undefined reference to `mysql_fetch_row'
anonimcidreject.c:(.text+0x16a): undefined reference to `mysql_fetch_lengths'
anonimcidreject.c:(.text+0x1bf): undefined reference to `mysql_fetch_row'
anonimcidreject.c:(.text+0x254): undefined reference to `mysql_error'
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
make[2]: *** [/usr/share/call-taxi/call-taxi] Ошибка 1
make[2]: Выход из каталога `/home/devel/own/DEVELOPMENT-IDE/NetBeans/C/Call-Taxi_Phone_SFL2'
make[1]: *** [.build-conf] Ошибка 2
make[1]: Выход из каталога `/home/devel/own/DEVELOPMENT-IDE/NetBeans/C/Call-Taxi_Phone_SFL2'
make: *** [.build-impl] Ошибка 2

Оффлайн Yurror

  • Старожил
  • *
  • Сообщений: 1966
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #9 : 24 Декабря 2012, 07:55:15 »
Японский бох! :facepalm: три раза! Ну, блин, кто так делает?

yurik@yurik-pc:~$ mysql_config --cflags
-I/usr/include/mysql -DBIG_JOINS=1  -fno-strict-aliasing  -g
yurik@yurik-pc:~$ mysql_config --libs
-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl
yurik@yurik-pc:~$

Теперь, дети, внимание на доску. Учимся читать по слогам!
В соответствии с выводом команд приведенным выше:
1) я в упор не вижу стадию компиляции и какие у тебя там флаги. обязаны быть "-I/usr/include/mysql -DBIG_JOINS=1  -fno-strict-aliasing  -g" можно без -g. Без остального ты будешь огребать проблемы.
2) Я хз где ты надыбал вот это "-L/usr/lib/mysql -lmysqlclient" обязано быть "-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl"
3) Я хз куда ты там криво вписывал все эти флаги но, когда всё правильно указано, библиотеки NetBeans ставит после списка объектных файлов g++ -Wextra    -o dist/Debug/GNU-Linux-x86/cdr_uploader_1 build/Debug/GNU-Linux-x86/inotify_watch.o build/Debug/GNU-Linux-x86/main.o build/Debug/GNU-Linux-x86/dir_list.o build/Debug/GNU-Linux-x86/cdr_reader.o build/Debug/GNU-Linux-x86/txt_cdr_reader.o build/Debug/GNU-Linux-x86/process_files.o -L/usr/lib/oracle/11.2/client64/lib -lboost_thread -locci -lclntsh -lnnz11 -lrt
для примера

Это очень важно! Ибо gcc собирает всё по порядку, у тебя он берет библиотеку (если конечно вообще её находит) смотрит что она ему нафиг не упала и выкидывает её. Берет все объектники, собирает их и говорит что им не хватает символов (они были в библиотеке, но он её уже выкинул)

То что у тебя что-то собирается на одной платформе и не собирается на другой это значит что напрямую нельзя пихать флаги от одной сборки mysql для другой и надеяться на авось. Придерживайся правил сборки установленных разработчиками mysql и всё будет в порядке.



Примерно так
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Вход в каталог `/home/yurik/work/mysql_test_1'
rm -f -r build/Debug
rm -f dist/Debug/GNU-Linux-x86/mysql_test_1
make[1]: Выход из каталога `/home/yurik/work/mysql_test_1'


ОЧИСТИТЬ SUCCESSFUL (общее время: 62ms)

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Вход в каталог `/home/yurik/work/mysql_test_1'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/mysql_test_1
make[2]: Вход в каталог `/home/yurik/work/mysql_test_1'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
g++ -std=c++0x -fno-strict-aliasing   -c -g -DBIG_JOINS=1 -I/usr/include/mysql -std=c++0x -fno-strict-aliasing -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -std=c++0x -fno-strict-aliasing    -o dist/Debug/GNU-Linux-x86/mysql_test_1 build/Debug/GNU-Linux-x86/main.o -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lz -lm -lpthread -lrt -ldl
make[2]: Выход из каталога `/home/yurik/work/mysql_test_1'
make[1]: Выход из каталога `/home/yurik/work/mysql_test_1'


СОБРАТЬ SUCCESSFUL (общее время: 776ms)


« Последнее редактирование: 24 Декабря 2012, 08:12:53 от Yurror »

Оффлайн utooz

  • Автор темы
  • Новичок
  • *
  • Сообщений: 16
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #10 : 24 Декабря 2012, 11:23:58 »
Спасибо за "разжеванную" информацию. Для решения задачи "на сейчас" очень актуально.

ТОлько мне все равно непонятно почему четыре года в Ubuntu 8.04 10.04,11.04, Centos, FreeBSD, SuSe все компилилось, имея только -L/usr/lib/mysql -lmysqlclient в дополнительных параметрах компилятора, а в Ubuntu 11.10 и 12.04 стало таким правильным.
Кроме того я не помню чтоб хоть раз пришлось "точить" под ось или архитектуру. Всегда просто и тупо заливался весь проект NetBeans, делался make  и прога собиралась туда куда надо без всяких заморочек. И только с версии 11.10 и младше возникли проблемы. САма прога менялась, дополнялась, разрасталась, но сам проект NetBeans никогда не перестраивался и просто копипастился при апгрейдах систем.

Так вот, интересует "Что изменилось в Ubuntu" такое, какое не позволяет собираться с мускулем старой и проверенной годами и установками проге?

Оффлайн Yurror

  • Старожил
  • *
  • Сообщений: 1966
    • Просмотр профиля
Re: Ubuntu 12.04 и линковщик MySql проблема
« Ответ #11 : 24 Декабря 2012, 12:24:21 »
Ответ простой. "Потому что везло" надо понимать что от куда берется. Заложились на то на что нельзя было надеяться. Получили в последствии геморрой.

 

Страница сгенерирована за 0.026 секунд. Запросов: 22.