• 0

[C++] Problems Linking to CZipArchive


Question

I'm trying to use CZipArchive, I managed to get it to compile into an existing project eventually, but whenever I opened a Zip, it always returned the file count as 0.

So now I'm trying to get the Zip functionality working in a brand new project, but I can't get it to compile. I've followed the instructions here.

But when compiling I get the following error:

main.obj : error LNK2001: unresolved external symbol "public: void __thiscall CZipArchive::Open(

Here's my code:

#include "ZipArchive.h"

int main(int argc, char **argv)
{
	CZipArchive zip;
	zip.Open(_T("c:\\test.zip"));
	//zip.ExtractFile(0, _T("c:\\"));  
	zip.Close(); 
}

I've linked to th libary in project settings and set the library path, but it doesn't seem to find it. Does anyone have any ideas what I could be doing wrong?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Add the .cpp file to your project.

I've added the whole of the CZipArchive project to the solution, but it makes no difference, it still can't seem to find the library.

Link to comment
Share on other sites

  • 0

1) be sure that the lib is added to both debug & release project settings, or, alternatively, use

#pragma comment(lib, "yourlibname") here.

2) This just seems to be a zlib wrapper, be sure to link against zlib also.

Link to comment
Share on other sites

  • 0
1) be sure that the lib is added to both debug & release project settings, or, alternatively, use

#pragma comment(lib, "yourlibname") here.

2) This just seems to be a zlib wrapper, be sure to link against zlib also.

1) Is in both settings and I've trued #pragma comment(lib,"ZipArchive.lib") as well, no difference.

2) The sourc includes the Zlib source as well, so do I still need to link against zlib?

Thanks for help :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.