1

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?

user3471387
  • 287
  • 3
  • 7
  • 10

2 Answers2

1

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.

Buddhika
  • 423
  • 2
  • 12
0

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

  • 1
    Would you please more detail ? What to add exactly to the system environment variable? And, how to modify the prject config? – user3471387 Mar 28 '14 at 06:12
  • You have to add the libpng /bin path to the system environment variable. –  Mar 28 '14 at 06:25