cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: compile libcurl into the application (MSVC)

From: Cyber Core <cybercorecentre_at_gmail.com>
Date: Fri, 17 Jul 2009 16:48:10 +0200

OK let's see first problem, after I set the vars with that sdk bat and tried
to build it with nmake was:

.\curl_addrinfo.c(138) : error C2065: 'EAI_MEMORY' : undeclared identifier
.\curl_addrinfo.c(145) : error C2037: left of 'ai_flags' specifies undefined
str
uct/union 'addrinfo'
.\curl_addrinfo.c(146) : error C2037: left of 'ai_family' specifies
undefined st
ruct/union 'addrinfo'
.\curl_addrinfo.c(147) : error C2037: left of 'ai_socktype' specifies
undefined
struct/union 'addrinfo'
.\curl_addrinfo.c(148) : error C2037: left of 'ai_protocol' specifies
undefined
struct/union 'addrinfo'
.\curl_addrinfo.c(154) : error C2037: left of 'ai_addrlen' specifies
undefined s
truct/union 'addrinfo'
.\curl_addrinfo.c(154) : error C2037: left of 'ai_addr' specifies undefined
stru
ct/union 'addrinfo'
.\curl_addrinfo.c(155) : error C2037: left of 'ai_addrlen' specifies
undefined s
truct/union 'addrinfo'
.\curl_addrinfo.c(161) : error C2037: left of 'ai_addr' specifies undefined
stru
ct/union 'addrinfo'
.\curl_addrinfo.c(161) : warning C4022: 'memcpy' : pointer mismatch for
actual p
arameter 2
.\curl_addrinfo.c(161) : error C2168: 'memcpy' : too few actual parameters
for i
ntrinsic function
.\curl_addrinfo.c(164) : error C2037: left of 'ai_canonname' specifies
undefined
 struct/union 'addrinfo'
.\curl_addrinfo.c(165) : error C2037: left of 'ai_canonname' specifies
undefined
 struct/union 'addrinfo'
.\curl_addrinfo.c(165) : error C2198: 'Curl_cstrdup' : too few actual
parameters

.\curl_addrinfo.c(184) : error C2037: left of 'ai_next' specifies undefined
stru
ct/union 'addrinfo'
.\curl_addrinfo.c(189) : warning C4013: 'freeaddrinfo' undefined; assuming
exter
n returning int
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\PROGRA~1\Microsoft Visual
Studio\VC98\BIN\NMAKE.
EXE"' : return code '0x2'
Stop.

But I sucessfully built the libcurl.lib with using the msvc ide and the
provided project workspace.
I built it in "WIN32 LIB RELEASE mode".

Now I deleted the old libs and tried to recompile my main project (what I
want to compile curl into) with having these in the global include file:

#define CURL_STATICLIB
#pragma comment(lib,"libcurl.lib")
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

Once again I build my project in multithreaded release mode.
The errors I getting now during the build process:

MSVCRT.lib(MSVCRT.dll) : error LNK2005: _calloc already defined in
LIBCMT.lib(calloc.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in
LIBCMT.lib(realloc.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in
LIBCMT.lib(free.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in
LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fwrite already defined in
LIBCMT.lib(fwrite.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in
LIBCMT.lib(strchr.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strtoul already defined in
LIBCMT.lib(strtol.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strstr already defined in
LIBCMT.lib(strstr.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in
LIBCMT.lib(memmove.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _tolower already defined in
LIBCMT.lib(tolower.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _atoi already defined in
LIBCMT.lib(atox.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in
LIBCMT.lib(isctype.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in
LIBCMT.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fseek already defined in
LIBCMT.lib(fseek.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memchr already defined in
LIBCMT.lib(memchr.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncmp already defined in
LIBCMT.lib(strncmp.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in
LIBCMT.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fgets already defined in
LIBCMT.lib(fgets.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fopen already defined in
LIBCMT.lib(fopen.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in
LIBCMT.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strtol already defined in
LIBCMT.lib(strtol.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fputc already defined in
LIBCMT.lib(fputc.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __errno already defined in
LIBCMT.lib(dosmap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __lseeki64 already defined in
LIBCMT.lib(lseeki64.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in
LIBCMT.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _getenv already defined in
LIBCMT.lib(getenv.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __strdup already defined in
LIBCMT.lib(strdup.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __open already defined in
LIBCMT.lib(open.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __close already defined in
LIBCMT.lib(close.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __read already defined in
LIBCMT.lib(read.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __stricmp already defined in
LIBCMT.lib(stricmp.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __strnicmp already defined in
LIBCMT.lib(strnicmp.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other
libs; use /NODEFAULTLIB:library
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_unbind_s
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_msgfree
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_next_entry
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ber_free
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_next_attribute
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_memfree
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_value_free_len
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_get_values_len
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_first_attribute
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_get_dn
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_first_entry
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_search_s
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_simple_bind_s
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_init
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_set_option
libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_err2string

So what now?

On Tue, Jul 14, 2009 at 3:50 PM, Guenter <lists_at_gknw.net> wrote:

> Hi,
> Cyber Core schrieb:
> > Please someone write it down step by step from 0 what to download, how
> > to build the static library, how to link it with the final app etc.
> download either current release from here:
> http://curl.haxx.se/download.html
> http://curl.haxx.se/download/curl-7.19.5.zip
> or get latest snapshot which is mostly as good a the release unless we
> have just broken the code in CVS :) :
> http://cool.haxx.se/curl-daily/
>
> extact the downloaded archive, then open ./docs/INSTALL and lookup the
> section 'MSVC from command line' which was written for MSVC6.
>
> If you feel that something's missing then tell us here.
>
> GŁn.
>
>
>
Received on 2009-07-17