Question

I'm trying to use libpng into my project. I've installed it, by downloading the setup of the Complete package, except sources from here and executing that .exe installation file.

But when I include it using

#include <png.h>

or

#pragma comment(lib, "png.h")

this wouldn't work. How do I please to correctly install it to be able to include it?

Was it helpful?

Solution

You have to add the library path to the system environment variable. You can modify the project configurations by adding the c++ directories to the library include path and lib path.

Configurations depends on the IDE you're using..

For VS; In VS project setting; set these variables. C/C++ general --> Additional include directories; libpng \include path Linker --> General --> Additional library directories; libpng \lib path

Also, add the /bin path to the Windows System 'path' Environment variable.

OTHER TIPS

Your compiler can't find the libpng location on the system. Check the environment variables and Project configurations.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top