curl-library
Re: Trouble with curl init
Date: Tue, 12 Jul 2011 13:01:07 +0100
Are you compiling from the command line? If so what command line are you
using? It sounds like you arn't linking against the curl library properly.
Assuming the library is in you LIbrary paths then you should be able to add
-lcurl to your commandline.
Rob
On 12 July 2011 09:46, Yury Ghirin <ghirin_at_bigmir.net> wrote:
> Hi!
> I am pretty new in Linux coding and I have trouble with compiling proogram
> with curl support.
>
> QT version is 4.7.4 64 bit.
> OS: Debian 6.0.1a 64 bit.
>
> Here is the code:
> -=-=-=-=-=-=-=-=-=-=-CUT HERE-=-=-=-=-=-=-=-=-=-=
> #include <QtGui/QApplication>
> #include "dialog.h"
> #include <curl/curl.h>
>
> int main(int argc, char *argv[])
> {
> Dialog w;
> CURL *curl;
> w.show();
> curl = curl_easy_init(); << The error comes here
> ...
> //Some code skipped
> }
> -=-=-=-=-=-=-=-=-=-=-CUT HERE-=-=-=-=-=-=-=-=-=-=
>
> The error text:
> : undefined reference to `curl_easy_init'
> CURL Version:
>
> curl 7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/
> 1.2.3.4 libidn/1.15 libssh2/1.2.5
> Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s
> rtsp scp sftp smtp smtps telnet tftp
> Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
>
> How should I define it?
>
> Please help me to solve it.
>
> Thanks for your wonderfull help.
>
>
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>
-- ------------------------------ Rob Ward www.rob-ward.co.uk
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-07-12