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

fatal error: png.h: No such file or directory #558

Open
linrio opened this issue Nov 20, 2020 · 0 comments
Open

fatal error: png.h: No such file or directory #558

linrio opened this issue Nov 20, 2020 · 0 comments

Comments

@linrio
Copy link

linrio commented Nov 20, 2020

$ make flif
make: pkg-config: Command not found
make: pkg-config: Command not found
make: pkg-config: Command not found
make: Warning: File 'Makefile' has modification time 134 s in the future
g++ -c -std=gnu++11    -DLODEPNG_NO_COMPILE_PNG -DLODEPNG_NO_COMPILE_DISK -DNDEBUG -O2 -ftree-vectorize -flto -Wall -fPIC -o maniac/chance.o maniac/chance.cpp
g++ -c -std=gnu++11    -DLODEPNG_NO_COMPILE_PNG -DLODEPNG_NO_COMPILE_DISK -DNDEBUG -O2 -ftree-vectorize -flto -Wall -fPIC -o maniac/symbol.o maniac/symbol.cpp
g++ -c -std=gnu++11    -DLODEPNG_NO_COMPILE_PNG -DLODEPNG_NO_COMPILE_DISK -DNDEBUG -O2 -ftree-vectorize -flto -Wall -fPIC -o image/crc32k.o image/crc32k.cpp
g++ -c -std=gnu++11    -DLODEPNG_NO_COMPILE_PNG -DLODEPNG_NO_COMPILE_DISK -DNDEBUG -O2 -ftree-vectorize -flto -Wall -fPIC -o image/image.o image/image.cpp
g++ -c -std=gnu++11    -DLODEPNG_NO_COMPILE_PNG -DLODEPNG_NO_COMPILE_DISK -DNDEBUG -O2 -ftree-vectorize -flto -Wall -fPIC -o image/image-png.o image/image-png.cpp
image/image-png.cpp:18:10: fatal error: png.h: No such file or directory
 #include <png.h>
          ^~~~~~~
compilation terminated.
Makefile:41: recipe for target 'image/image-png.o' failed
make: *** [image/image-png.o] Error 1

you should add -DFLIF_USE_STB_IMAGE in makefile :

line2: CXXFLAGS := $(CXXFLAGS) $(shell pkg-config --cflags zlib libpng) -DLODEPNG_NO_COMPILE_PNG -DLODEPNG_NO_COMPILE_DISK -DFLIF_USE_STB_IMAGE
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