LibPNG static linking with VS2012 64bit

2k views Asked by At

I can't manage to link LibPNG statically to my VS2012(64bit) project. I did the following:

  1. Download libPNG source code for the latest version(1614).
  2. Open the enclosed VisualStudio solution (projects/vstudio/vstudio.sln).
  3. Select "Release Library" and set C/C++ -> Code Generation ->Runtime Library to "MDd" (same as in my project.

    4.Compile static lib.

Then in the target project in the linker I specify in Additional Library directories the location of the lib and in the Input the name of the lib.

I also configured Zlib to be static as is proposed here.

Yet,when compiling I am getting :

error LNK2019: unresolved external symbol png_sig_cmp referenced in function

For the very first function call to LibPNG API.

I have tried to tweak different properties of the lib but it doesn't work.Can it happen because the libPNG built as x86 lib and not x64?

1

There are 1 answers

0
SatA On BEST ANSWER

So to sum up the comments, the solution here was to compile libPNG in 64bit mode.

You cannot compile 32bit assembly with 64bit assembly.