cURL / Mailing Lists / curl-library / Single Mail

curl-library

Visual C++ 2005 Express Edition Woes

From: Daniel Cater <djcater_at_gmail.com>
Date: Fri, 6 Jul 2007 15:22:20 +0100

Hello,

I downloaded http://curl.haxx.se/download/libcurl-7.15.5-win32-msvc.zip
and extracted it, then tried to build a simple FTP application, but it
crashes. Details follow:

I'm running Windows 2000, and the steps I used are as follows:

1. Run Visual C++ 2005 Express Edition
2. New -> Project...
3. Project Types: Win32, Templates: Win32 Console Application, Name: ftp
4. Type of application: Console application
5. Additional Options: Empty Project
6. Rightl-click on project, Properties
7. Configuration Properties -> Linker -> Input -> Additional
Dependencies: libcurl.lib
8. Right-click Source Files, Add -> New Item...
9. Categories: Visual C++: Code -> C++ file (.cpp), Name: ftp
10. Renamed ftp.cpp to ftp.c
11. Copied and pasted contents of docs/examples/ftpgetresp.c into ftp.c
12. Right-click on project, Properties
13. Configuration Properties -> C/C++ -> Advanced -> Compile As:
Compile as C Code (/TC)
14. Preprocessor -> Preprocessor Definitions:
CURL_STATICLIB;CURL_DISABLE_LDAP;CURL_DISABLE_DICT
15. General -> Additional Include Directories: Added location of
include directory
15. Configuration Properties -> Additional Library Directories: Set to
location of libcurl.lib (and libcurl.dll)
16. Downloaded http://prdownloads.sourceforge.net/libpng/zlib123-dll.zip?download
and extracted it
17. Added zlib include path
18. Added zlib lib path
19. Added zdll.lib to project
20. Added zlib1.dll to PATH
21. Built and ran in debug mode: "ftp.exe - Ordinal Not Found" - "The
ordinal 55 could not be located in the dynamic link library
zlib1.dll". Hmm.
22. Removed zlib and zlib paths.
23. Downloaded and extracted
http://gnuwin32.sourceforge.net/downlinks/zlib-bin-zip.php instead.
24. Added zlib1.dll to PATH
25. Built and ran in debug mode. Build log: http://pastebin.com/943117
. Now no ordinal error (strange...).
26. Starts to run, then: "First-chance exception at 0x77fac57c in
ftp.exe: 0xC0000008: An invalid handle was specified." - Line 51 "res
= curl_easy_perform(curl);"
27. Debug log: http://pastebin.com/943119 .
28. Added "curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);" to see when it crashes.
29. Console log: http://pastebin.com/943120 . It always crashes after
"< 150 Accepted data connection ".
31. Using ethereal I can see that the directory listing is
transmitted, but it doesn't make it to the console or to the
ftp-responses file. See
http://img2.freeimagehosting.net/image.php?794cf4708a.png , especially
after the 150. There's the FTP-DA stream (http://pastebin.com/943171)
then a FIN+ACK, ACK, ACK, 226, ACK, then RST and a lost packet.
http://pastebin.com/943169 contains the other stream.

Any ideas? If you need any other information, please ask. I've tried a
lot to solve this, but have run out of ideas. I'm still a beginner in
C really, so if I made any silly mistakes please point them out!
Received on 2007-07-07