www.delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Message-ID: | <418E653B.6050507@users.sourceforge.net> |
Date: | Sun, 07 Nov 2004 13:11:07 -0500 |
From: | Yaakov Selkowitz <yselkowitz AT users DOT sourceforge DOT net> |
User-Agent: | Mozilla Thunderbird 0.8 (Windows/20040913) |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Problems linking against libcurl under cygwin |
References: | <23508 DOT 69 DOT 170 DOT 37 DOT 57 DOT 1099849565 DOT squirrel AT 69 DOT 170 DOT 37 DOT 57> |
In-Reply-To: | <23508.69.170.37.57.1099849565.squirrel@69.170.37.57> |
X-Enigmail-Version: | 0.86.1.0 |
X-Enigmail-Supports: | pgp-inline, pgp-mime |
X-Authentication-Info: | Submitted using SMTP AUTH at out005.verizon.net from [68.161.106.28] at Sun, 7 Nov 2004 12:11:08 -0600 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jason Riffel wrote: | Hi - New to Cygwin for development, not new to development. | | Have a project that uses libcurl which will not link under Cygwin. All of the | basic libcurl APIs show up as unresolved in the link process. | | Example: | | gcc -L/usr/local/lib -lcurl -shared ../../shared/htmlparse/htmlparse.o ../../sha | red/wwwfetch/wwwfetch.o ../shared/free.o key.o -o key.so | key.o(.text+0x3ae):key.c: undefined reference to `_curl_global_init' | key.o(.text+0x3b3):key.c: undefined reference to `_curl_easy_init' | key.o(.text+0x420):key.c: undefined reference to `_curl_easy_setopt' | key.o(.text+0x42b):key.c: undefined reference to `_curl_easy_perform' | key.o(.text+0x436):key.c: undefined reference to `_curl_easy_cleanup' | collect2: ld returned 1 exit status | make: *** [key.so] Error 1 | [SNIP] | | Are there special linking requirements under Cygwin or something obvious I'm | missing? Link libraries must be listed *AFTER* all object files and static libraries. So the following should work instead: gcc -L/usr/local/lib -shared ../../shared/htmlparse/htmlparse.o ../../shared/wwwfetch/wwwfetch.o ../shared/free.o key.o -o key.so `curl-config --libs` Note that -lcurl isn't enough here, since curl depends on other libraries (namely, from openssl-devel and zlib). BTW, the Cygwin convention is to use the extenstion .dll for shared libraries (except for Ruby modules, for reasons unknown to me). Yaakov -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBjmU7piWmPGlmQSMRAqqfAJ98UCDaMBHVxYkAdu12iC8vr3snsgCfdJMf JLOlydNDvEjob7E6nSl41ps= =cNCe -----END PGP SIGNATURE----- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |