What does it mean for such error?

I am using mac mavericks. When I ran a c++ program on my computer, I found it needs <png.h> but in my mac no such thing. Then I found online there are such file and hence I downloaded it. Then I include it in my code as #include"png.h"

I don't know whether this would work.

After that I ran the code and got the following problem (I am using g++ compiler):
1
2
3
4
5
6
Undefined symbols for architecture x86_64:
  "_png_create_info_struct", referenced from:
      PNG::_read_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in epng.o
      PNG::writeToFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in epng.o

......


I have to admit that here I omit a lot of details about the program. But if anyone has a rough idea about what's happening is greatly appreciated!
Last edited on
http://www.cplusplus.com/forum/general/113904/

> I found it needs <png.h> but in my mac no such thing
try to install the `libpng' package
You're probably not linking with libpng. I believe you're interested in this part of ne555's FAQ post.
http://www.cplusplus.com/forum/general/113904/#msg622060

-Albatross
He's just linking with the x86 version while compiling for x64?
for architecture x86_64:
Topic archived. No new replies allowed.