Sponsored Content
Top Forums Programming [MSYS2/GCC-TDM] Compiler not finding headers in /usr/local/include Post 302932920 by AntumDeluge on Monday 26th of January 2015 11:13:46 AM
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:
 

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

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

8. 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
MYSQL_CONFIG(1) 					       MySQL Database System						   MYSQL_CONFIG(1)

NAME
mysql_config - get compile options for compiling clients SYNOPSIS
mysql_config options DESCRIPTION
mysql_config provides you with useful information for compiling your MySQL client and connecting it to MySQL. mysql_config supports the following options. o --cflags Compiler flags to find include files and critical compiler flags and defines used when compiling the libmysqlclient library. The options returned are tied to the specific compiler that was used when the library was created and might clash with the settings for your own compiler. Use --include for more portable options that contain only include paths. o --include Compiler options to find MySQL include files. o --libmysqld-libs, --embedded Libraries and options required to link with the MySQL embedded server. o --libs Libraries and options required to link with the MySQL client library. o --libs_r Libraries and options required to link with the thread-safe MySQL client library. o --plugindir The default plugin directory path name, defined when configuring MySQL. This option was added in MySQL 5.1.24. o --port The default TCP/IP port number, defined when configuring MySQL. o --socket The default Unix socket file, defined when configuring MySQL. o --variable=VAR Path to MySQL include, library and plugin directories. VAR is one of `pkgincludedir`, `pkglibdir` and `plugindir`, respectively. o --version Version number for the MySQL distribution. If you invoke mysql_config with no options, it displays a list of all options that it supports, and their values: shell> mysql_config Usage: /usr/local/mysql/bin/mysql_config [options] Options: --cflags [-I/usr/local/mysql/include/mysql -mcpu=pentiumpro] --include [-I/usr/local/mysql/include/mysql] --libs [-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto] --libs_r [-L/usr/local/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm -lpthread] --socket [/tmp/mysql.sock] --port [3306] --version [4.0.16] --libmysqld-libs [-L/usr/local/mysql/lib/mysql -lmysqld -lpthread -lz -lcrypt -lnsl -lm -lpthread -lrt] You can use mysql_config within a command line to include the value that it displays for a particular option. For example, to compile a MySQL client program, use mysql_config as follows: shell> CFG=/usr/local/mysql/bin/mysql_config shell> sh -c "gcc -o progname `$CFG --include` progname.c `$CFG --libs`" When you use mysql_config this way, be sure to invoke it within backtick ("`") characters. That tells the shell to execute it and substitute its output into the surrounding command. COPYRIGHT
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Sun Microsystems, Inc. (http://www.mysql.com/). MySQL 5.1 04/06/2010 MYSQL_CONFIG(1)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy