Libpng help

CodeLite installation/troubleshooting forum
ids5621
CodeLite Curious
Posts: 4
Joined: Tue Apr 07, 2015 2:05 pm
Genuine User: Yes
IDE Question: c++
Contact:

Libpng help

Post 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.
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Libpng help

Post 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
ids5621
CodeLite Curious
Posts: 4
Joined: Tue Apr 07, 2015 2:05 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Libpng help

Post 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?
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Libpng help

Post by eranif »

Posting the entire build log will help
See the "HOW TO POST" thread (in my signature)

Eran
Make sure you have read the HOW TO POST thread
ids5621
CodeLite Curious
Posts: 4
Joined: Tue Apr 07, 2015 2:05 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Libpng help

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Libpng help

Post by eranif »

Where did you install zlib.h?
Locate that file and add its path to: project settings->common settings->compiler->include paths

Eran
Make sure you have read the HOW TO POST thread
ids5621
CodeLite Curious
Posts: 4
Joined: Tue Apr 07, 2015 2:05 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Libpng help

Post 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.
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Libpng help

Post 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.
Post Reply