cURL / Mailing Lists / curl-library / Single Mail

curl-library

Compiling and linking a libcurl app in UEFI

From: Sourjo Basu <SourjoB_at_ami.com>
Date: Thu, 28 Aug 2008 11:33:03 -0400

I recently completed a stripped down port of libcurl so that it can be
used in a UEFI environment for ftp and proxy. This meant using some
#undefs and setting some #defines to 0 as well as some code commenting.
Also I had to include headers from the efi toolkit (libc, berkely
libsocket libraries etc) instead of the windows headers libcurl
automatically tried to default to.

After I built the libcurl.lib (my version was about 1 MB in size), I
created a ftp proxy application and tried to compile and link it against
my modified libcurl library (as well as the other efi toolkit
libraries). I did not get a libcurl.dll however, just a libcurl.lib. I
am using custom makefiles that I have created from a previous UEFI
library template. I keep getting the following link errors however:

main.obj : error LNK2019: unresolved external symbol
__imp__curl_global_cleanup referenced in function _main
main.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_cleanup referenced in function _main
main.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_perform referenced in function _main
main.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_setopt referenced in function _main
main.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_init referenced in function _main
main.obj : error LNK2019: unresolved external symbol
__imp__curl_global_init referenced in function _main

I have C_FLAGS = /D -DCURL_STATICLIB __STDC__ $(C_FLAGS) in my
application makefile so I am not sure why I am getting these errors. I
created a similar console application in windows earlier and linked it
to a static libcurl library using -DCURL_STATICLIB without any
problems. Would appreciate any input.

Regards,
Sourjo Basu
American Megatrends Inc
Received on 2008-08-28