Hey! :)

I found the functions in the chilkat-library usefull, so i downloaded it. If you havn't figured it out yet, I use the programming language C++ and i use the visual studio express IDE.

What I do, is:
1: Save the chilkat-folders at the HDD.
2: Open Project/solutions-settings and add the include and library-folders to the list.
3: Use one of the examples at chilkat's websites.

When i use one example, I use this one:

#include <CkFtp2.h>
#include <CkString.h>

void ChilkatSample(void)
    {
    CkFtp2 ftp;

    bool success;

    //  Any string unlocks the component for the 1st 30-days.
    success = ftp.UnlockComponent("Anything for 30-day trial");
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    ftp.put_Hostname("ftp.chilkatsoft.com");
    ftp.put_Username("****");
    ftp.put_Password("****");

    //  The default data transfer mode is "Active" as opposed to "Passive".

    //  Connect and login to the FTP server.
    success = ftp.Connect();
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    //  Change to the remote directory where the file will be uploaded.
    success = ftp.ChangeRemoteDir("junk");
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    //  Upload a file.
    CkString localFilename;
    localFilename = "hamlet.xml";
    CkString remoteFilename;
    remoteFilename = "hamlet.xml";

    success = ftp.PutFile(localFilename,remoteFilename);
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    ftp.Disconnect();

    printf("File Uploaded!\n");
    }

This won't compile, so i include the headers stdio, time and windows. But, of course, I have no entry point, so I create this main function:

int main()
{
	ChilkatSample();
	return 0;
}

I get plenty of linking-errors!

1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CkFtp2::Disconnect(void)" (?Disconnect@CkFtp2@@QAE_NXZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CkString::~CkString(void)" (??1CkString@@UAE@XZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CkFtp2::PutFile(char const *,char const *)" (?PutFile@CkFtp2@@QAE_NPBD0@Z) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall CkString::operator char const *(void)" (??BCkString@@QAEPBDXZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: class CkString & __thiscall CkString::operator=(char const *)" (??4CkString@@QAEAAV0@PBD@Z) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall CkString::CkString(void)" (??0CkString@@QAE@XZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CkFtp2::ChangeRemoteDir(char const *)" (?ChangeRemoteDir@CkFtp2@@QAE_NPBD@Z) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CkFtp2::Connect(void)" (?Connect@CkFtp2@@QAE_NXZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall CkFtp2::put_Password(char const *)" (?put_Password@CkFtp2@@QAEXPBD@Z) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall CkFtp2::put_Username(char const *)" (?put_Username@CkFtp2@@QAEXPBD@Z) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall CkFtp2::put_Hostname(char const *)" (?put_Hostname@CkFtp2@@QAEXPBD@Z) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CkFtp2::~CkFtp2(void)" (??1CkFtp2@@UAE@XZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: char const * __thiscall CkFtp2::lastErrorText(void)" (?lastErrorText@CkFtp2@@QAEPBDXZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CkFtp2::UnlockComponent(char const *)" (?UnlockComponent@CkFtp2@@QAE_NPBD@Z) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall CkFtp2::CkFtp2(void)" (??0CkFtp2@@QAE@XZ) referenced in function "void __cdecl ChilkatSample(void)" (?ChilkatSample@@YAXXZ)

> 2: Open Project/solutions-settings and add the include and library-folders to the list.
You also need to add the library name(s) as well to the list of additional libraries (also on the linker settings somewhere).

This article has been dead for over six months. Start a new discussion instead.