udoprog / c10t

A minecraft cartography tool
Other
225 stars 50 forks source link

Build Fails on Mac 10.7.2 #194

Closed jgillman closed 12 years ago

jgillman commented 12 years ago

Output on 'make c10t' using the ae5698cd627fc6e4d0d2a721c476e37481a1b63e (most recent) commit.

$ make c10t

Scanning dependencies of target c10t-nbt
[  3%] Building CXX object src/nbt/CMakeFiles/c10t-nbt.dir/nbt.cpp.o
Linking CXX static library libc10t-nbt.a
[  3%] Built target c10t-nbt
Scanning dependencies of target c10t-mc
[  7%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/blocks.cpp.o
[ 11%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/level.cpp.o
[ 15%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/utils.cpp.o
[ 19%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/world.cpp.o
[ 23%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/region.cpp.o
Linking CXX static library libc10t-mc.a
[ 23%] Built target c10t-mc
Scanning dependencies of target c10t-image
[ 26%] Building CXX object src/image/CMakeFiles/c10t-image.dir/image_operations.cpp.o
[ 30%] Building CXX object src/image/CMakeFiles/c10t-image.dir/image_base.cpp.o
[ 34%] Building CXX object src/image/CMakeFiles/c10t-image.dir/memory_image.cpp.o
[ 38%] Building CXX object src/image/CMakeFiles/c10t-image.dir/cached_image.cpp.o
[ 42%] Building CXX object src/image/CMakeFiles/c10t-image.dir/color.cpp.o
[ 46%] Building CXX object src/image/CMakeFiles/c10t-image.dir/algorithms.cpp.o
Linking CXX static library libc10t-image.a
[ 46%] Built target c10t-image
Scanning dependencies of target c10t
[ 50%] Building CXX object src/CMakeFiles/c10t.dir/main.cpp.o
In file included from /Users/jgillman/Desktop/c10t/src/main.cpp:24:
/Users/jgillman/Desktop/c10t/src/image/format/png.hpp: In static member function ‘static bool png_format::save(image_base*, const std::string&, png_
config&)’:
/Users/jgillman/Desktop/c10t/src/image/format/png.hpp:48: error: ‘Z_DEFAULT_STRATEGY’ was not declared in this scope
make[3]: *** [src/CMakeFiles/c10t.dir/main.cpp.o] Error 1
make[2]: *** [src/CMakeFiles/c10t.dir/all] Error 2
make[1]: *** [src/CMakeFiles/c10t.dir/rule] Error 2
make: *** [c10t] Error 2

$

Originally tried installing with Homebrew but it only seems to build pre-1.8 maps. --version on the brew installed one reports "SNAPSHOT".

2bits commented 12 years ago

I just came across this, as I was working up a Homebrew formula for the 1.7 tarball to replace the old 1.4 one. The new version fails to compile with errors about the boost-1.47.0 this has a dep on:

/tmp/homebrew-c10t-1.7-0KnA/udoprog-c10t-af6c021/src/fileutils.hpp:57:31: error: no viable conversion from 'boost::filesystem3::path' to 'std::string const'
  (aka 'const basic_string<char>')
      if (!file_filter(itr->path().filename())) {
                          ^

That could explain why the current formula is for 1.4.

Hawk777 commented 12 years ago

The solution to the original bug is that src/image/format/png.hpp needs to #include . The libpng manual at http://www.libpng.org/pub/png/libpng-manual.txt always shows zlib.h being #included wherever png_set_compression_strategy() is called. This bug applies not only to Mac OS but also to some Linuces.

Hawk777 commented 12 years ago

Apparently Github's comment system is horrible and removes angle-brackets. The comment above was supposed to refer to #include <zlib.h>.

Hawk777 commented 12 years ago

Pull request #196 issued regarding this issue.

udoprog commented 12 years ago

Try, and reopen if issue still exists

2bits commented 12 years ago

Thanks for figuring that out and getting them to merge the fix upstream.