0

I installed libpng and zlib and want to run this program using png.h. I have Code::Blocks and I'm completely new in IT. I don't know why it doesn't run. I get the following:

undefined reference to png_create_write_struct.

Should I also do something to add libraries in Code::Blocks menu?

rchojn
  • 1

1 Answers1

1

You also need to install the -dev packages if you do software development (what you already did, if you ran the command from your link).

libpng12-0:
This package contains the runtime library files needed to run software using libpng.

libpng12-dev
This package contains the header and development files needed to build programs and packages using libpng.

Furthermore, in Code::Blocks right-click on the projectname in the projects-tree, and select "Build options...". In the upcoming window select the top of the tree on the left side (you project name). In the mainpart of the window select "Linker settings". In the left listbox add an entry with the name

libpng

Now your project should compile fine.

enter image description here

cmks
  • 1,904