1

I try to follow the solution to this question:

Using pHash from .NET

which lead me to:

Loading PNGs with CImg

I have define cimg_use_png in Project properties > Configuration Properties > C / C++ > Preprocessor > Edit Preprocessor Definitions

enter image description here

But how do I add -lpng to the linker flags ?

I tried to add it to Linker > Command Line like this: enter image description here

But I got this warning: 1>LINK : warning LNK4044: unrecognized option '/lpng'; ignored

Community
  • 1
  • 1
Irwan
  • 783
  • 1
  • 13
  • 28
  • Visual Studio doesn't work that way. You would want to add the library as an additional dependency in the Linker->Input property page. It would seem you have already done so as libpng.lib is listed in the command line. – Retired Ninja Jun 27 '14 at 00:38
  • @RetiredNinja: thanks, but it still crash when opening png file. Maybe the error lies elsewhere. Can you make your comment an answer so I can accept it ? – Irwan Jun 27 '14 at 00:47
  • You have to place libpng.dll ( and all dependent dlls) parallel to your application – PankajM Jun 27 '14 at 13:10
  • 1
    @PankajM: I have done that. The crash is from png_read_info in Cimg – Irwan Jun 27 '14 at 20:32

0 Answers0