Professional Web Applications Themes

Libcurl dependencies - Mac Programming

Hi, I'm trying to use libcurl to do some simple ftp work. When I link with libcurl.a I get new link errors for symbols used by libcurl itself: Link Error : undefined: 'restFP' (code) Referenced from 'time2str' in libcurl.a Link Error : undefined: 'saveFP' (code) Referenced from 'time2str' in libcurl.a Link Error : undefined: 'X509_free' (code) Referenced from 'passwd_callback' in libcurl.a Link Error : undefined: 'SSL_get_verify_result' (code) Referenced from 'passwd_callback' in libcurl.a Link Error : undefined: 'X509_get_issuer_name' (code) Referenced from 'passwd_callback' in libcurl.a Link Error : undefined: 'CRYPTO_free' (code) Referenced from 'passwd_callback' in libcurl.a Link Error : undefined: 'SSL_get_peer_certificate' (code) ...

  1. #1

    Default Libcurl dependencies

    Hi,

    I'm trying to use libcurl to do some simple ftp work.
    When I link with libcurl.a I get new link errors for symbols used by libcurl
    itself:

    Link Error : undefined: 'restFP' (code)
    Referenced from 'time2str' in libcurl.a

    Link Error : undefined: 'saveFP' (code)
    Referenced from 'time2str' in libcurl.a

    Link Error : undefined: 'X509_free' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_get_verify_result' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'X509_get_issuer_name' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'CRYPTO_free' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_get_peer_certificate' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CIPHER_get_name' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_get_current_cipher' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'ERR_error_string' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'ERR_get_error' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_connect' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_set_fd' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_load_verify_locations' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_set_verify' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_new' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSLv3_client_method' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSLv2_client_method' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSLv23_client_method' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_library_init' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_load_error_strings' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'X509_NAME_oneline' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'X509_get_subject_name' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'X509_STORE_CTX_get_current_cert' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_check_private_key' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'EVP_PKEY_copy_parameters' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_get_privatekey' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'X509_get_pubkey' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_get_certificate' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_new' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_use_PrivateKey_file' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_use_certificate_file' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_set_default_passwd_cb' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'RAND_file_name' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'RAND_seed' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'RAND_egd' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'RAND_load_file' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'RAND_status' (code)
    Referenced from 'passwd_callback' in libcurl.a

    Link Error : undefined: 'SSL_CTX_free' (code)
    Referenced from 'alarmfunc' in libcurl.a

    Link Error : undefined: 'SSL_free' (code)
    Referenced from 'passwd_callback' in libcurl.a
    Referenced from 'alarmfunc' in libcurl.a

    Link Error : undefined: 'SSL_set_connect_state' (code)
    Referenced from 'passwd_callback' in libcurl.a
    Referenced from 'alarmfunc' in libcurl.a

    Link Error : undefined: 'SSL_shutdown' (code)
    Referenced from 'alarmfunc' in libcurl.a

    Link Error : undefined: 'SSL_read' (code)
    Referenced from 'slist_get_last' in libcurl.a

    Link Error : undefined: 'SSL_get_error' (code)
    Referenced from 'slist_get_last' in libcurl.a

    Link Error : undefined: 'SSL_write' (code)
    Referenced from 'slist_get_last' in libcurl.a

    I cannot find the static libs I need to solve these errors. For example, SSL
    is available, but only as a dylib.

    Anyone knows where I can find those libs ?

    Eric

    Eric Guest

  2. #2

    Default Re: Libcurl dependencies

    dans l'article BBFD8DE3.17311%fr, Eric VERGNAUD à
    fr a écrit le 11/12/03 2:58:
     

    Ok, things are getting better. I downloaded OpenSSL, and god knows how, I
    managed to build it and install it.

    I've still got 4 errors left:

    Link Error : undefined: 'restFP' (code)
    Referenced from 'time2str' in libcurl.a

    Link Error : undefined: 'saveFP' (code)
    Referenced from 'time2str' in libcurl.a

    Link Error : undefined: '__udivdi3' (code)
    Referenced from 'fmtstr' in libcrypto.a

    Link Error : undefined: '__umoddi3' (code)
    Referenced from 'BN_add_word' in libcrypto.a
    Referenced from 'fmtstr' in libcrypto.a


    Any help will be appreciated.

    Eric

    Eric Guest

  3. #3

    Default Re: Libcurl dependencies

    Eric VERGNAUD <fr> wrote: 
     [/ref]
     
     
     
     
     
     

    curl-config is your friend. To find out the libraries you need to link against, run
    this:
    % curl-config --libs
    And to get the compiler flags
    % curl-config --cflags

    The curl homepage is really quite good. Check it out:
    http://curl.tsuren.net/libcurl/c/the-guide.html

    --
    *--------------------------------------------------------*
    | ^Nothing is foolproof to a sufficiently talented fool^ |
    | Heath Raftery, HRSoftWorks _\|/_ |
    *______________________________________m_('.')_m__ _______*
    Heath Guest

  4. #4

    Default Re: Libcurl dependencies

    In article <BBFD9B96.17322%fr>,
    Eric VERGNAUD <fr> wrote:
     
    >
    > Ok, things are getting better. I downloaded OpenSSL, and god knows how, I
    > managed to build it and install it.[/ref]

    Err, I think the operative phrase might be "god knows why". Mac OS X
    includes OpenSSL at /usr/lib/libssl.dylib.

    When I was experimenting with libcurl a while ago, I was able to compile
    and link with this command:

    gcc curltest.c -lssl -lcurl -lcrypto

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See http://www.atomicbird.com/
    Tom Guest

  5. #5

    Default Re: Libcurl dependencies

    In article <BBFD9B96.17322%fr>,
    Eric VERGNAUD <fr> wrote:
     
    >
    > Ok, things are getting better. I downloaded OpenSSL, and god knows how, I
    > managed to build it and install it.
    >
    > I've still got 4 errors left:
    >
    > Link Error : undefined: 'restFP' (code)
    > Referenced from 'time2str' in libcurl.a
    >
    > Link Error : undefined: 'saveFP' (code)
    > Referenced from 'time2str' in libcurl.a
    >
    > Link Error : undefined: '__udivdi3' (code)
    > Referenced from 'fmtstr' in libcrypto.a
    >
    > Link Error : undefined: '__umoddi3' (code)
    > Referenced from 'BN_add_word' in libcrypto.a
    > Referenced from 'fmtstr' in libcrypto.a[/ref]

    Google for 'restFP'.

    Hope this helps,
    Eric

    --
    Eric Albert edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  6. #6

    Default Re: Libcurl dependencies

    dans l'article tph-BB739F.20535510122003localhost, Tom Harrington à
    no.spam.dammit.net a écrit le 11/12/03 4:53:
     
    >>
    >> Ok, things are getting better. I downloaded OpenSSL, and god knows how, I
    >> managed to build it and install it.[/ref]
    >
    > Err, I think the operative phrase might be "god knows why". Mac OS X
    > includes OpenSSL at /usr/lib/libssl.dylib.
    >
    > When I was experimenting with libcurl a while ago, I was able to compile
    > and link with this command:
    >
    > gcc curltest.c -lssl -lcurl -lcrypto[/ref]

    Well remember that the initial disaster started with libcurl, which is what
    I'm trying to use, not ssl.

    Libcurl is provided as a static library, not a dylib. So libssl.dylib is of
    no use there, the compiler can't link against it (I tried it).

    If you know a way to use libcurl without libcurl.a, or to link with
    libssl.dylib, I'll BUY it.

    Why in the earth aren't those dylibs provided with what is required to link
    them ?

    Eric

    Eric Guest

  7. #7

    Default Re: Libcurl dependencies

    dans l'article stanford.edu, Eric Albert
    à edu a écrit le 11/12/03 7:47:
     

    Well that's definitely an advice ! Do you think I jump on this list each
    time I ask myself something ? I only ask questions when I can't find
    understandable answers in the docs and on the net.

    Being a newbie to unix, my questions may seem silly to other people, but if
    unix's docs were as clear as MacOS's and Win32's docs, I wouldn't have any
    questions.

    Eric

    Eric Guest

  8. #8

    Default Re: Libcurl dependencies

    In article <BBFE401A.1739A%fr>,
    Eric VERGNAUD <fr> wrote:
     
    > >
    > > Err, I think the operative phrase might be "god knows why". Mac OS X
    > > includes OpenSSL at /usr/lib/libssl.dylib.
    > >
    > > When I was experimenting with libcurl a while ago, I was able to compile
    > > and link with this command:
    > >
    > > gcc curltest.c -lssl -lcurl -lcrypto[/ref]
    >
    > Well remember that the initial disaster started with libcurl, which is what
    > I'm trying to use, not ssl.[/ref]

    It doesn't matter. The version of libcurl supplied with Mac OS X uses
    functions found in libssl and libcrypto, so if you don't link those
    libraries, you can't use libcurl. It doesn't matter if you aren't using
    the ssl and crypto features, because libcurl.a needs those libraries to
    be present.
     

    Then I guess I must have been hallucinating when I used the command I
    mentioned above, and the application not only compiled but ran as
    expected.
     

    Its shown above. I have a PayPal account, so I'll wait to hear from
    you. :-)
     

    They are.

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See http://www.atomicbird.com/
    Tom Guest

  9. #9

    Default Re: Libcurl dependencies

    In article <BBFE4120.1739C%fr>,
    Eric VERGNAUD <fr> wrote:
     
    >
    > Well that's definitely an advice ! Do you think I jump on this list each
    > time I ask myself something ? I only ask questions when I can't find
    > understandable answers in the docs and on the net.[/ref]

    Well, let's see. I just did the suggested search, and the very first
    page in the result list explains what the problem is and how to fix it.
    What about that page did you not understand?

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See http://www.atomicbird.com/
    Tom Guest

  10. #10

    Default Re: Libcurl dependencies

    dans l'article tph-2B438F.09383711122003localhost, Tom Harrington à
    no.spam.dammit.net a écrit le 11/12/03 17:38:
     
    >>
    >> Well remember that the initial disaster started with libcurl, which is what
    >> I'm trying to use, not ssl.[/ref]
    >
    > It doesn't matter. The version of libcurl supplied with Mac OS X uses
    > functions found in libssl and libcrypto, so if you don't link those
    > libraries, you can't use libcurl. It doesn't matter if you aren't using
    > the ssl and crypto features, because libcurl.a needs those libraries to
    > be present.

    >
    > Then I guess I must have been hallucinating when I used the command I
    > mentioned above, and the application not only compiled but ran as
    > expected.

    >
    > Its shown above. I have a PayPal account, so I'll wait to hear from
    > you. :-)

    >
    > They are.[/ref]

    Ok Tom,

    I'm using CodeWarrior, not gcc. How can I link libcurl.a in a CW Mach0 app
    without getting all the other stuff ?

    Eric

    Eric Guest

  11. #11

    Default Re: Libcurl dependencies

    dans l'article tph-C71329.09393711122003localhost, Tom Harrington à
    no.spam.dammit.net a écrit le 11/12/03 17:39:
     
    >>
    >> Well that's definitely an advice ! Do you think I jump on this list each
    >> time I ask myself something ? I only ask questions when I can't find
    >> understandable answers in the docs and on the net.[/ref]
    >
    > Well, let's see. I just did the suggested search, and the very first
    > page in the result list explains what the problem is and how to fix it.
    > What about that page did you not understand?[/ref]

    Ok I guess I missed the first link. Must have been very late.

    Eric Guest

  12. #12

    Default Re: Libcurl dependencies

    dans l'article stanford.edu, Eric Albert
    à edu a écrit le 11/12/03 7:47:
     
    >>
    >> Ok, things are getting better. I downloaded OpenSSL, and god knows how, I
    >> managed to build it and install it.
    >>
    >> I've still got 4 errors left:
    >>
    >> Link Error : undefined: 'restFP' (code)
    >> Referenced from 'time2str' in libcurl.a
    >>
    >> Link Error : undefined: 'saveFP' (code)
    >> Referenced from 'time2str' in libcurl.a
    >>
    >> Link Error : undefined: '__udivdi3' (code)
    >> Referenced from 'fmtstr' in libcrypto.a
    >>
    >> Link Error : undefined: '__umoddi3' (code)
    >> Referenced from 'BN_add_word' in libcrypto.a
    >> Referenced from 'fmtstr' in libcrypto.a[/ref]
    >
    > Google for 'restFP'.
    >
    > Hope this helps,
    > Eric[/ref]

    Eric I apologize for my previous answer. Must have been very late.

    Eric

    Eric Guest

  13. #13

    Default Re: Libcurl dependencies

    In article <BBFE629F.173D1%fr>,
    Eric VERGNAUD <fr> wrote:
     

    No idea, I do not use CodeWarrior. Maybe someone from Metrowerks can
    help.

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See http://www.atomicbird.com/
    Tom Guest

  14. #14

    Default Re: Libcurl dependencies

    dans l'article tph-97FB14.16382511122003localhost, Tom Harrington à
    no.spam.dammit.net a écrit le 12/12/03 0:38:
     
    >
    > No idea, I do not use CodeWarrior. Maybe someone from Metrowerks can
    > help.[/ref]

    Ok I managed my way out:
    libcurl.a requires:

    Libcrypto.a
    Libssl.a
    Libgcc.a (thanks Eric Albert)
    Libdl.a (tanks Apple)

    Eric

    Eric Guest

Similar Threads

  1. libcurl on Windows boxes ?
    By tomazi75@gmail.com in forum PERL Modules
    Replies: 21
    Last Post: July 12th, 01:25 PM
  2. Any OSX libcurl experts?
    By Steve in forum Mac Programming
    Replies: 7
    Last Post: November 29th, 06:39 PM
  3. #25774 [Bgs]: Problems with libcurl + kerberos
    By maido at net-style dot it in forum PHP Development
    Replies: 0
    Last Post: October 8th, 01:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139