Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure on GCC 5.2.0 #1

Closed
Earnestly opened this issue Sep 13, 2015 · 1 comment
Closed

Build failure on GCC 5.2.0 #1

Earnestly opened this issue Sep 13, 2015 · 1 comment

Comments

@Earnestly
Copy link

  • libpng: 1.6.18
  • zlib 1.2.8

I am guessing the dependencies based on the linker arguments, if I am missing
any please do mention them:

g++ -std=gnu++11 -DNDEBUG -O3 -g0 -Wall maniac/util.c maniac/chance.cpp image/crc32k.c image/image.cpp image/image-png.cpp image/image-pnm.cpp image/color_range.cpp transform/factory.cpp flif.cpp -lpng -o flif
image/image-png.cpp: In function ‘int image_save_png(const char*, const Image&)’:
image/image-png.cpp:133:37: error: ‘Z_BEST_COMPRESSION’ was not declared in this scope
   png_set_compression_level(png_ptr,Z_BEST_COMPRESSION);
                                     ^
Makefile:2: recipe for target 'flif' failed
make: *** [flif] Error 1
@Earnestly
Copy link
Author

Was caused by a missing zlib.h include in image-cpp.h. This was apparently fixed in commit 3efcfce and the build now proceeds. Please consider maybe using pkg-config for the flags such as:

CXXFLAGS := $(shell pkg-config --cflags zlib libpng)
LDFLAGS := $(shell pkg-config --libs zlib libpng)

And then using an appropriate makefile which (re)uses proper rules. Consider this simple example: https://github.com/vodik/envoy/blob/master/Makefile

Also see:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant