Доброго времени суток.
Пытаюсь собрать вот такой сырок в Code::Blocks:
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "[url]http://example.com[/url]");
/* example.com is redirected, so we tell libcurl to follow redirection */
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
но получаю вот это:
Показать
-------------- Build: Debug in parser (compiler: GNU GCC Compiler)---------------
g++ -L/home/toor/Projects/parser/ -L/usr/lib/ -o bin/Debug/parser obj/Debug/parser.o /home/toor/Projects/parser/curl/curl.h /home/toor/Projects/parser/curl/curl.h /home/toor/Projects/parser/curl/curl.h /usr/bin/curl
/usr/bin/ld: ошибка в /usr/bin/curl(.eh_frame); таблиц .eh_frame_hdr создана не будет.
/usr/bin/ld: предупреждение: тип раздела «.bss» изменён на PROGBITS
obj/Debug/parser.o: In function `main':
/home/toor/Projects/parser/parser.c:8: undefined reference to `curl_easy_init'
/home/toor/Projects/parser/parser.c:10: undefined reference to `curl_easy_setopt'
/home/toor/Projects/parser/parser.c:12: undefined reference to `curl_easy_setopt'
/home/toor/Projects/parser/parser.c:15: undefined reference to `curl_easy_perform'
/home/toor/Projects/parser/parser.c:18: undefined reference to `curl_easy_strerror'
/home/toor/Projects/parser/parser.c:22: undefined reference to `curl_easy_cleanup'
/usr/bin/ld: bin/Debug/parser: Невозможно отсортировать перемещения - они разных размеров
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
Process terminated with status 1 (0 minutes, 1 seconds)
6 errors, 0 warnings (0 minutes, 1 seconds)
если собирать в терминале вот так:
gcc parser.c -lcurl
то сборка проходит и в каталоге появляется a.out
В IDE прописаны такие пути:
Показать


Подскажите пожалуйста в чем загвоздка и где при указании -llib ищется библиотека и как сделать так чтобы она подтягивалась из папки с проектом.