stdafx.h - problem c++

0
// Visual C++ Example Source Code to create a Zip file
//

#include "stdafx.h"

#include "CkZip.h"
#include "CkZipEntry.h"

void testCreateZip(void)
{
    // Unlock the Zip product.
    // This only needs to be done once when the first CkZip object
    // is instantiated.  Any string automatically starts a fully-functional
    // 30-day trial.
    CkZip zip;
    bool success = zip.UnlockComponent("Anything for 30-day trial.");
    if (!success)
	{
	printf("%s\n",zip.lastErrorText());
	return;
	}

    // Create a new Zip and append files and directories recursively.
    zip.NewZip("myZip.zip");

    success = zip.AppendFiles("./Tree/*",true,0);
    if (!success)
	{
	printf("%s\n",zip.lastErrorText());
	return;
	}

    success = zip.WriteZipAndClose(0);
    if (!success)
	{
	printf("%s\n",zip.lastErrorText());
	return;
	}

    // Memory Leaks?  See CkSettings for more information about how
    // many C++ programmers mistakenly think there are memory leaks.

}

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    testCreateZip();
    return 0;

} 

jest to przykład ze strony http://www.example-code.com/vcpp/vcCreateZip.asp dotyczacy biblioteki do kompresji

pytanie można jakoś zdobyć i załatwić sprawe z tym stdafx.h pisze w eclipsie pod windowsem

0

A jak wyrzucisz includa to coś złego się dzieje?

0

nie znajduje stdafx.h jak dodam windows.h to nie znajduje printf jak usune prinfty nie widzi niczego z biblioteki

0

a jak dodasz windows.h i stdio.h?

0

To wygląda jak aplikacja konsolowa. A stdafx.h wygląda jakbyś chciał korzystać z PCH. To nie jest przykład kopiuj wklej btw. Trzeba trochę wiedzieć o co chodzi.
Zamiast "stdafx.h" wrzuć <windows.h> i <cstdio> a

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    testCreateZip();
    return 0;
 
}

zamień na

int main()
{
    testCreateZip();
}

A projekt to ma być aplikacja konsolowa.

1 użytkowników online, w tym zalogowanych: 0, gości: 1