Модераторы: xvr
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> проблема с libcurl + libpq (static) 
:(
    Опции темы
Temdegon
Дата 8.5.2009, 18:10 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 429
Регистрация: 11.10.2008
Где: Minsk

Репутация: нет
Всего: 9



подключаю следующие библиотеки:
-L./lib -Wl,-rpath,./lib -static-libgcc -static -lidn -ldl -lpq -lssl -lcrypt -lcrypto -lz -lc -lm -lcurl 
без использования функций из lcurl все компилируется без проблем. 
Как только начинаю использовать функции из libcurl получаю следующие ошибки компиляции (без -static все компилится)
Код

cd '/home/odium/projects/kdevelop/lcrond/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" LC_MESSAGES="C" LC_CTYPE="C" make -k
make all-recursive
Entering directory /home/odium/projects/kdevelop/lcrond/debug
Making all in src
Entering directory /home/odium/projects/kdevelop/lcrond/debug/src
linking lcrond (libtool)
linking lcrond (g++)
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libpq.a(thread.o): In function `pqGetpwuid':
thread.c:(.text+0x19): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libpq.a(ip.o): In function `pg_getaddrinfo_all':
ip.c:(.text+0x41f): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libcurl.a(strerror.o): In function `Curl_idn_strerror':
strerror.c:(.text+0x2cb): undefined reference to `idna_strerror'
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libcurl.a(url.o): In function `fix_hostname':
url.c:(.text+0xa2e): undefined reference to `stringprep_check_version'
url.c:(.text+0xa53): undefined reference to `idna_to_ascii_lz'
url.c:(.text+0xa5a): undefined reference to `stringprep_locale_charset'
url.c:(.text+0xa93): undefined reference to `idna_to_unicode_lzlz'
url.c:(.text+0xaf8): undefined reference to `tld_check_lz'
url.c:(.text+0xb0d): undefined reference to `idn_free'
url.c:(.text+0xb1e): undefined reference to `tld_strerror'
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libcurl.a(url.o): In function `Curl_disconnect':
url.c:(.text+0xfb5): undefined reference to `idn_free'
url.c:(.text+0xfc7): undefined reference to `idn_free'
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libcurl.a(ldap.o): In function `Curl_ldap':
ldap.c:(.text+0x8e): undefined reference to `ldap_url_parse'
ldap.c:(.text+0xa6): undefined reference to `ldap_err2string'
ldap.c:(.text+0xd7): undefined reference to `ldap_msgfree'
ldap.c:(.text+0xf0): undefined reference to `ldap_free_urldesc'
ldap.c:(.text+0x102): undefined reference to `ldap_unbind_s'
ldap.c:(.text+0x1b8): undefined reference to `ldap_set_option'
ldap.c:(.text+0x1d0): undefined reference to `ldap_set_option'
ldap.c:(.text+0x1eb): undefined reference to `ldap_init'
ldap.c:(.text+0x228): undefined reference to `ldap_simple_bind_s'
ldap.c:(.text+0x26c): undefined reference to `ldap_search_s'
ldap.c:(.text+0x28b): undefined reference to `ldap_first_entry'
ldap.c:(.text+0x2bd): undefined reference to `ldap_get_dn'
ldap.c:(.text+0x33b): undefined reference to `ldap_first_attribute'
ldap.c:(.text+0x365): undefined reference to `ldap_get_values_len'
ldap.c:(.text+0x506): undefined reference to `ldap_set_option'
ldap.c:(.text+0x51e): undefined reference to `ldap_set_option'
ldap.c:(.text+0x537): undefined reference to `ldap_value_free_len'
ldap.c:(.text+0x565): undefined reference to `ldap_memfree'
ldap.c:(.text+0x57e): undefined reference to `ldap_next_attribute'
ldap.c:(.text+0x594): undefined reference to `ldap_memfree'
ldap.c:(.text+0x5ab): undefined reference to `ber_free'
ldap.c:(.text+0x5bd): undefined reference to `ldap_next_entry'
ldap.c:(.text+0x616): undefined reference to `ldap_set_option'
ldap.c:(.text+0x648): undefined reference to `ldap_simple_bind_s'
ldap.c:(.text+0x666): undefined reference to `ldap_err2string'
ldap.c:(.text+0x69f): undefined reference to `ldap_err2string'
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libcurl.a(content_encoding.o): In function `inflate_stream':
content_encoding.c:(.text+0x1ea): undefined reference to `inflate'
content_encoding.c:(.text+0x21d): undefined reference to `inflateEnd'
content_encoding.c:(.text+0x244): undefined reference to `inflateEnd'
content_encoding.c:(.text+0x267): undefined reference to `inflateInit2_'
content_encoding.c:(.text+0x2fb): undefined reference to `inflateEnd'
content_encoding.c:(.text+0x326): undefined reference to `inflateEnd'
content_encoding.c:(.text+0x33b): undefined reference to `inflateEnd'
content_encoding.c:(.text+0x361): undefined reference to `inflateEnd'
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libcurl.a(content_encoding.o): In function `Curl_unencode_gzip_write':
content_encoding.c:(.text+0x4d8): undefined reference to `zlibVersion'
Leaving directory /home/odium/projects/kdevelop/lcrond/debug/src
Entering directory /home/odium/projects/kdevelop/lcrond/debug
content_encoding.c:(.text+0x510): undefined reference to `inflateInit2_'
content_encoding.c:(.text+0x56f): undefined reference to `inflateInit2_'
content_encoding.c:(.text+0x5b4): undefined reference to `inflateEnd'
content_encoding.c:(.text+0x625): undefined reference to `inflateEnd'
content_encoding.c:(.text+0x67c): undefined reference to `inflateEnd'
/home/odium/projects/kdevelop/lcrond/debug/src/lib/libcurl.a(content_encoding.o): In function `Curl_unencode_deflate_write':
content_encoding.c:(.text+0x751): undefined reference to `inflateInit_'
collect2: ld returned 1 exit status
Entering directory /home/odium/projects/kdevelop/lcrond/debug
Leaving directory /home/odium/projects/kdevelop/lcrond/debug
Entering directory /home/odium/projects/kdevelop/lcrond/debug
make[2]: *** [lcrond] Error 1
make[2]: Target `all' not remade because of errors.
Leaving directory /home/odium/projects/kdevelop/lcrond/debug
Entering directory /home/odium/projects/kdevelop/lcrond/debug
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***


Ubuntu 8.10, среда KDevelop, gcc 4.3.2
PM MAIL   Вверх
xvr
Дата 12.5.2009, 19:45 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Комодератор
Сообщений: 7046
Регистрация: 28.8.2007
Где: Дублин, Ирландия

Репутация: 20
Всего: 223



-lcurl перенести в начало списка библиотек (при линковке). Или указать ld флаг для многопроходной линковки библиотек (увы не помню как называется)

PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "С/С++: Программирование под Unix/Linux"
xvr
  • Проставьте несколько ключевых слов темы, чтобы её можно было легче найти.
  • Не забывайте пользоваться кнопкой "Код".
  • Вопросы мобильной разработки тут
  • Телепатов на форуме нет! Задавайте чёткий, конкретный и полный вопрос. Указывайте полностью ошибки компилятора и компоновщика.
  • Новое сообщение должно иметь прямое отношение к разделу форума. Флуд, флейм, оффтопик запрещены.
  • Категорически запрещается обсуждение вареза, "кряков", взлома программ и т.д.

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, xvr.

 
 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | C/C++: Программирование под Unix/Linux | Следующая тема »


 




[ Время генерации скрипта: 0.1555 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.