0

I created a Windows Store App c# in Visual Studio 12. There, I need to use native C++ code that uses minizip and zlib.

To use the native C++ code I created a Windows Runtime Component (http://msdn.microsoft.com/en-us/library/windows/apps/hh755833.aspx). It works. I compiled zlib in Visual Studio (libzip with Visual Studio 2010), but I don't know how can I use

#include <zlib>

in a cpp file in my Windows Runtime Component Proyect.

I saw that I can install zlib.net NuGet with the Manager, in VS. But the same...

// Class1.cpp
#include "pch.h"
#include "Class1.h"

using namespace MyWindowsRuntimeComponent;
using namespace Platform;

#include <zlib.h> //cannot open source file zlib

Class1::Class1()
{
}

bool Class1::unzip(char* file) {
    unzFile zip = unzOpen(file); //need to call this function
    //...
}

Thanks!

Community
  • 1
  • 1
JoniJnm
  • 720
  • 2
  • 10
  • 19
  • Is your Windows Store app a C# one? Have you added the reference to the project? – Rowland Shaw Oct 25 '13 at 15:14
  • AFAIK zlib is a C project. Are you sure you don't want `#include `? What do you mean with "use a #include"? – harper Oct 25 '13 at 15:15
  • My Windows Store App is done with C#, but I need to call native C++ code that uses zlib (thats why I created the other proyect: Windows Runtime Component), and in this code, in a cpp file (or c file) I need to use a "#include " to use zlib functions. – JoniJnm Oct 29 '13 at 11:36
  • set path of zlib include directory in project settings an duse zlib.h – kunal Oct 29 '13 at 11:52
  • possible duplicate of [portable zip library for C/C++ (not an application)](http://stackoverflow.com/questions/262899/portable-zip-library-for-c-c-not-an-application) – Hans Passant Oct 29 '13 at 13:01

0 Answers0