[MSYS2/GCC-TDM] Compiler not finding headers in /usr/local/include


 
Thread Tools Search this Thread
Top Forums Programming [MSYS2/GCC-TDM] Compiler not finding headers in /usr/local/include
# 1  
Old 01-26-2015
Question [MSYS2/GCC-TDM] Compiler not finding headers in /usr/local/include

I hope it's okay to post this here. I'm working on Windows computer but using the Unix-like environment MSYS2 (https://sourceforge.net/projects/msys2).

My problem is that I can't get the compiler to find headers located in /usr/local/include. I am trying to compile libpng which wants the header "zlib.h":
Code:
$ ../configure --disable-static LDFLAGS="-L/usr/local/lib" CXXLAGS="-I/usr/local/include"
...
...
...
checking for zlibVersion in -lz... yes
...
...
...

$ make
rm -f pnglibconf.c pnglibconf.tf[45]
gawk -f ../scripts/options.awk out=pnglibconf.tf4 version=search\
    ../pngconf.h ../scripts/pnglibconf.dfa\
    ../pngusr.dfa  1>&2
gawk -f ../scripts/options.awk out=pnglibconf.tf5 pnglibconf.tf4 1>&2
rm pnglibconf.tf4
mv pnglibconf.tf5 pnglibconf.c
rm -f pnglibconf.out pnglibconf.tf[12]
test -d scripts || mkdir scripts || test -d scripts
gcc -E -DHAVE_CONFIG_H -I. -I.. \
     -DPNGLIB_LIBNAME='PNG16_0' -DPNGLIB_VERSION='1.6.16' -DSYMBOL_PREFIX='' -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE  pnglibconf.c > pnglibconf.tf1
pnglibconf.c:33:19: fatal error: zlib.h: No such file or directory
 # include <zlib.h>
                   ^
compilation terminated.
Makefile:2143: recipe for target 'pnglibconf.out' failed
make: *** [pnglibconf.out] Error 1

$ ls /usr/local/include | grep zlib
zlib.h

I have no clue why it's not finding it.

[code]$ whereis ld
ld: /mingw64tdm/bin/ld.exe

$ ld --verbose | grep SEARCH
SEARCH_DIR("/mingw64tdm/x86_64-w64-mingw32/lib"); SEARCH_DIR("/mingw64tdm/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");[/code]


Anyone have any ideas?

--- Edit ---

Sorry, that part about the linker was not necessary.

--- Edit ---

Ugh! I was using the wrong variable. "CXXFLAGS" should have been "CPPFLAGS".

Last edited by AntumDeluge; 01-26-2015 at 12:27 PM.. Reason: Delete linker command.
This User Gave Thanks to AntumDeluge For This Post:
# 2  
Old 01-26-2015
Thanks for posting the solution. IT may help someone else.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Can I replace the gcc, and along with all other binaries, in MSYS2 minGW64 with the MinGW64 Project

Can I replace the gcc, and along with all other binaries too, in MSYS2 minGW64 with ones by MinGW64 Project Can i safely replace the gcc, if asked, telling its version: gcc.exe (Rev2, Built by MSYS2 project) 6.2.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see... (1 Reply)
Discussion started by: abdulbadii
1 Replies

2. BSD

FreeBSD: /usr/bin/ld not looking in /usr/local/lib

I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries. I was trying to compile the latest version of Kanatest from svn. The autorgen.sh script seems to exit without too much trouble: $ ./autogen.sh checking... (2 Replies)
Discussion started by: AntumDeluge
2 Replies

3. AIX

What LPP provides /usr/include/des_crypt.h ?

as in subject. I've got bos.rte.security and I see /usr/lib/libdes.a , but the des_crypt.h header is not to be found. I'm running 6.1 and need an answer for that release, BTW. TIA! (1 Reply)
Discussion started by: maraixadm
1 Replies

4. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

5. UNIX for Dummies Questions & Answers

Option in sql script to include column headers when spooling file to .csv format

Can anyone help me how to include COLUMN HEADER when spooling file to .CSV format through SQL statement. Thanks, Akbar (4 Replies)
Discussion started by: s1a2m3
4 Replies

6. Programming

gcc does not include certain .h-files

Hi there! gcc seems not to include available files, see below: What should I do? Look forward to your reply/replies! Thanks Grahamb In the source directory I enter: #gcc -Wall -I/usr/include ./gtkdaq.c > ./out.log 2>&1 Response: In file included from ./gtkdaq.c:3:... (2 Replies)
Discussion started by: grahamb
2 Replies

7. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

8. Solaris

Path /usr/include/iso not found

Hello, I got a make compilation error saying make: *** No rule to make target `/usr/include/iso/stdio_iso.h', needed by `.test.d'. Stop. The mentioned folder `/usr/include/iso/' doesnt exist in solaris5.7 sparc that i am using. I need to know which package will actually install the... (1 Reply)
Discussion started by: Nads
1 Replies
Login or Register to Ask a Question