cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Win32 version of curl

From: Dave M <DaveM_at_mich.com>
Date: Tue, 01 Nov 2005 11:39:19 -0500

At 05:07 PM 10/31/2005 , Daniel Stenberg wrote:
>Yeps. You get these errors because you need to compile two files from the
>lib/ dir and link with when you build the curl executable.

If I compile the library alone it compiles. The files created include
timeval.obj, timeval.str, strtoofft.obj and strtoofft.str and all are
located in the library debug folder.

Can you think of a reason why these would not be linked when I try to build
cURL?

Starting from the beginning, here are the steps I am using:

Visual Studio:

- Make a new win32 console application called cURL.
- Unzip the cURL files and folders (src,lib,include etc) to this new folder.
- Add all "cURL/src" .h & .c files to the project using
"Project-AddToProject-Files".
- Add lib path /I "lib" using "Project-Settings-C++-PreprocessorDefinitions"
- Add src path /I "src" using "Project-Settings-C++-PreprocessorDefinitions"
- Add include path /I "include" using
"Project-Settings-C++-PreprocessorDefinitions"
- Add include path /i "include" using
"Project-Settings-Resources-ProjectOptions"
- Add lib path /libpath:"lib\Debug" using
"Project-Settings-Link-ProjectOptions"
- Add libcurl.lib using "Project-Settings-Link-ProjectOptions"
- Add /D "CURL_STATICLIB" using "Project-Settings-C++-PreprocessorDefinitions"
- Add library project to cURL workspace using "Project-InsertProject"
cURL\lib\curllib.dsp
- Add librbry dependancy to cURL using "Project-Dependencies" then select
cURL and check curllib.
- Set the active project to curllib using "Project-SetActiveProject"
- Build the project using "Build-RebuildAll"
- Set the active project to cURL using "Project-SetActiveProject"
- Build the project using "Build-RebuildAll"

I get a few warnings when compiling curllib but it looks like lib/timeval.c
and lib/strtoofft.c are compiling.

But I still get link errors compiling cURL.
The errors I get compiling cURL are as follows:
--------------------Configuration: cURL - Win32 Debug--------------------
Linking...
main.obj : error LNK2001: unresolved external symbol _curlx_tvdiff
main.obj : error LNK2001: unresolved external symbol _curlx_tvnow
main.obj : error LNK2001: unresolved external symbol _curlx_strtoll
Debug/cURL.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

cURL.exe - 4 error(s), 0 warning(s)
--------------------------------------------------------------------------

The warnings I get when compiling curllib are as follows:
--------------------Configuration: curllib - Win32 Debug--------------------
Compiling...
base64.c
connect.c
content_encoding.c
cookie.c
dict.c
easy.c
escape.c
file.c
formdata.c
ftp.c
getenv.c
getinfo.c
gtls.c
hash.c
hostares.c
hostasyn.c
hostip.c
hostip4.c
hostip6.c
hostsyn.c
Generating Code...
Compiling...
hostthre.c
http.c
http_chunks.c
http_digest.c
http_negotiate.c
http_ntlm.c
if2ip.c
inet_ntop.c
inet_pton.c
krb4.c
ldap.c
llist.c
md5.c
memdebug.c
mprintf.c
multi.c
netrc.c
parsedate.c
progress.c
security.c
Generating Code...
Compiling...
select.c
sendf.c
share.c
speedcheck.c
sslgen.c
ssluse.c
strequal.c
strerror.c
strtok.c
strtoofft.c
telnet.c
tftp.c
d:\CPP\CURL\cURL\lib\tftp.c(280) : warning C4133: 'function' : incompatible
types - from 'struct tftp_packet *' to 'const char *'
d:\CPP\CURL\cURL\lib\tftp.c(347) : warning C4133: 'function' : incompatible
types - from 'struct tftp_packet *' to 'const char *'
d:\CPP\CURL\cURL\lib\tftp.c(372) : warning C4133: 'function' : incompatible
types - from 'struct tftp_packet *' to 'const char *'
d:\CPP\CURL\cURL\lib\tftp.c(437) : warning C4133: 'function' : incompatible
types - from 'struct tftp_packet *' to 'const char *'
d:\CPP\CURL\cURL\lib\tftp.c(457) : warning C4133: 'function' : incompatible
types - from 'struct tftp_packet *' to 'const char *'
timeval.c
transfer.c
url.c
version.c
Generating Code...
Linking...
    Creating library Debug/libcurl.lib and object Debug/libcurl.exp

libcurl.dll - 0 error(s), 5 warning(s)

-------------------------------
Dave M
Davem (at) Mich (dot) Com
Ann Arbor, Mich. USA
Endangered electronic species: http://www.eff.org/endangered/list.php
Received on 2005-11-01