Discussion:
FtpCommand unresolved symbol
(too old to reply)
c***@post.harvard.edu
2005-10-14 19:06:27 UTC
Permalink
I am using VC 6.0. I want to use FtpCommand. I have an old version of
Wininet.h and Wininet.lib. When I tried to upgrade wininet.h to a
version that contains FtpCommand I got a lot of compile errors. So I
just included the declaration of FtpCommand from the .h file:

BOOL WINAPI FtpCommandA(
IN HINTERNET hConnect,
IN BOOL fExpectResponse,
IN DWORD dwFlags,
IN LPCSTR lpszCommand,
IN DWORD * dwContext,
OUT HINTERNET *phFtpCommand OPTIONAL
);
BOOL WINAPI FtpCommandW(
IN HINTERNET hConnect,
IN BOOL fExpectResponse,
IN DWORD dwFlags,
IN LPCWSTR lpszCommand,
IN DWORD * dwContext,
OUT HINTERNET *phFtpCommand OPTIONAL
);
#ifdef UNICODE
#define FtpCommand FtpCommandW
#else
#define FtpCommand FtpCommandA
#endif


The program compiles but then I get an unresolved external
FTPFuncs.obj : error LNK2001: unresolved external symbol "int __stdcall
FtpCommandA(void *,int,unsigned long,char const *,unsigned long *,void
* *)" (?FtpCommandA@@***@Z)
Debug/QLSCM_CMMS.exe : fatal error LNK1120: 1 unresolved externals

I am using a wininet.lib file with date 3/26/2003.

What could be causing the link to fail? (Yes I am linking with
wininet.lib and there is only one version on my PC.)
ASmall
2005-11-13 16:21:02 UTC
Permalink
I found that I needed to install the latest Platform SDK (you can download
this
(http://www.microsoft.com/downloads/info.aspx?na=47&p=1&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&u=details.aspx%3ffamilyid%3dEBA0128F-A770-45F1-86F3-7AB010B398A3%26displaylang%3den)
or use the copy from the MSDN disks). The _project's_ include and library
directories then need changing to include the SDK include and library folders
first. This adds the new symbols and avoids bad cross references from trying
to patch in the include files separately.
I initially tried adding the SDK folders to the main Options|Directories (at
the top of the list), but found that older projects broke sometimes, so now
prefer to set the directories in the project.

Loading...