-1

I compile my Android project in QtCreator with BOOST_ALL_NO_LIB. This means I include all boost .cpp files right into my project. When I converted this project to Visual Studio project to try to build it for windows, one boost file started to cause problems: zlib.cpp

It contains these lines:

#include "zlib.h"   // Jean-loup Gailly's and Mark Adler's "zlib.h" header.
                    // To configure Boost to work with zlib, see the 
                    // installation instructions here:
                    // http://boost.org/libs/iostreams/doc/index.html?path=7

I don't understand how is this ever meant to compile, since the directory looks like this:

image description

That means the zlib.h is not there and cannot be included. Visual Studio experiences exactly that problem:

boost159\libs\iostreams\src\zlib.cpp(20): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory

At the same time, it compiles all right in QtCreator with qmake. So what's going on, how can it ever work? And how to make it work in Visual Studio 2010

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • I expect you will have to compile zlib yourself and add the header location to you additional include folders. http://www.zlib.net/ – drescherjm Nov 24 '15 at 11:54
  • @drescherjm Do you have any idea why does it work in QtCreator without any problems (I didn't configure it up). – Tomáš Zato Nov 24 '15 at 12:00
  • 1
    Its possible that the mingw that qtcreator includes for its compiler contains zlib. I do not have QtCreator under windows to here to check. You may want to search your system for zlib.h – drescherjm Nov 24 '15 at 12:07
  • This post seems to say that zlib is in Qt: http://stackoverflow.com/a/4013659/487892 – drescherjm Nov 24 '15 at 12:10

1 Answers1

2

You're supposed to have the library dependencies installed.

This means that zlib.h is in your system's include directories.

Your IDE might silently add some convenient libraries your include paths.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • Yeah, the related aspect is that quoted include does also search in include directories - I thought it only searches in the directory where source file is located. – Tomáš Zato Nov 24 '15 at 12:23