Page 1 of 1
Libpng help
Posted: Tue Apr 07, 2015 2:12 pm
by ids5621
I'm a major rookie and need some help. Ive installed the libpng library onto my system, yet I can't get codelite to import the library into a file. I keep getting the
"fatal error: png.h: No such file or directory". Any help?
Thanks.
Re: Libpng help
Posted: Tue Apr 07, 2015 2:28 pm
by nezos
Hi, i haven't used libpng but what i do for libraries is:
a) Include the location of include files under: Common Settings->Compiler->Include Paths
b) Include the location of the library under: Common Settings->Linker->Libraries Search Path
c) Put the name of the library under (without the DLL extension for windows): Common Settings->Linker->Libraries
Hope this helps
Re: Libpng help
Posted: Wed Apr 08, 2015 7:23 pm
by ids5621
nezos wrote:Hi, i haven't used libpng but what i do for libraries is:
a) Include the location of include files under: Common Settings->Compiler->Include Paths
b) Include the location of the library under: Common Settings->Linker->Libraries Search Path
c) Put the name of the library under (without the DLL extension for windows): Common Settings->Linker->Libraries
Hope this helps
I've followed the steps, but now i'm getting a "mingw32-make.exe: *** [All] Error 2" "Makefile:4: recipe for target 'All' failed" , regardless if I even don't include <png.h>.
Any help?
Re: Libpng help
Posted: Wed Apr 08, 2015 7:39 pm
by eranif
Posting the entire build log will help
See the "HOW TO POST" thread (in my signature)
Eran
Re: Libpng help
Posted: Wed Apr 08, 2015 7:43 pm
by ids5621
eranif wrote:Posting the entire build log will help
See the "HOW TO POST" thread (in my signature)
Eran
Code: Select all
C:\WINDOWS\system32\cmd.exe /C "C:/TDM-GCC-64/bin/mingw32-make.exe -j2 SHELL=cmd.exe -e -f Makefile"
"----------Building project:[ assignment - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/my/Documents/1/2/3/assignment'
C:/TDM-GCC-64/bin/g++.exe -c "C:/Users/my/Documents/1/2/3/assignment/main.cpp" -g -O0 -Wall -o ./Debug/main.cpp.o -I. -I"C:/Program Files (x86)/GnuWin32/include"
In file included from C:/Users/my/Documents/1/2/3/assignment/main.cpp:3:0:
C:/Program Files (x86)/GnuWin32/include/png.h:477:18: fatal error: zlib.h: No such file or directory
#include "zlib.h"
^
compilation terminated.
mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1
assignment.mk:93: recipe for target 'Debug/main.cpp.o' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/my/Documents/1/2/3/assignment'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
1 errors, 1 warnings
Here is the entire log. I'm rather clueless. Note, I had no issues, except with libpng specifically, until I did the above steps. When I revert those steps it works again, but I need to use libpng.
Thanks
Re: Libpng help
Posted: Wed Apr 08, 2015 8:23 pm
by eranif
Where did you install zlib.h?
Locate that file and add its path to: project settings->common settings->compiler->include paths
Eran
Re: Libpng help
Posted: Wed Apr 08, 2015 10:49 pm
by ids5621
eranif wrote:Where did you install zlib.h?
Locate that file and add its path to: project settings->common settings->compiler->include paths
Eran
I've never installed it. And prior to adding the libpng library, its never asked for it. If I remove the paths for the png library from the settings, it no longer brings up zlib.h and works.
Re: Libpng help
Posted: Thu Apr 09, 2015 7:11 pm
by nezos
The point is whether you need zlib.h or not. This is your decision, something you have to know and understand.
If you need it then you have to place it somewhere and point to it. Otherwise just remove any reference.