Click here to Skip to main content
15,897,371 members

How do I link a pngLib in VS2010

stigersh asked:

Open original thread
I want to load a png image into an array. I was told to download the CImg library.
The problem is that it uses the pngLib which I don't know how to link.
I downloaded some files from the libpng homepage, but adding the directory to additional include directories, the h files to the project and copying the zlib1.dll to the exe directory is not enough.

I get an error when I try to use the class:

myFloatImg (300,200);
string testFilename="testImage.png";
myFloatImg.load (filename.c_str());


the error:
c:\...\cimg.h(34670): error C3861: 'png_set_expand_gray_1_2_4_to_8': identifier not found

I guess it's a call to a function from pngLib
What should I do?
*openCV is not an option

Thanks!
Tags: C++, Graphics, Image

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900