Hi All,

I am trying to read pixel values of a PNG file using turbo C. I use lingpng library files. I started with following code

FILE *fp = fopen(file_name, "rb");
if (!fp) return;
fread(header, 1, number, fp);
is_png = !png_sig_cmp(header, 0, number);
if (!is_png) return;


when complie this, it gives no error. but when I run (or build all) it, it gives the following error

"Linker error:Undefined symbol __png_sig_cmp in module"

Please can any one help me in this problem? Do you have any idea of what is missing here?

thank you very much

Nilmin

Does libpng even work with such an ancient fossil compiler like turbo c ?

Consider using a compiler compatible with your OS.

Like salem said, you would be better off with a decent compiler such as gcc. If its not a problem with your compiler, then I'd guess you are not linking the library properly. Its been a while, but I had a play around with libpng once I dumped the code here on my site. It should work assuming its linked and compiled correctly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.