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
MRTG-UNIX-GUIDE(1)						       mrtg							MRTG-UNIX-GUIDE(1)

NAME
mrtg-unix-guide - The MRTG 2.17.4 Linux/Unix Installation Guide DESCRIPTION
MRTG comes to you in Source Code. This means that you have to compile parts of it before you can use it on a Unix machine. These instructions help you to do so. PREPARATION
In order to compile and use mrtg you need a C compiler and a copy of perl installed on your machine. In most cases this will already be available. In case it is not, here are some starting points. Below I'll give you a detailed run through the whole compilation process. GCC The GNU C compiler comes preinstalled on most of the free Unicies out there. For commercial derivatives you may have to download and compile it first. If you have no compiler at all there is a chicken and egg problem, but there are also precompiled versions of gcc available for most operating systems. http://gcc.gnu.org/ Perl Large parts of the MRTG system are written in the Perl scripting language. Make sure there is a recent copy of perl on your machine (try perl -v). At least version 5.005 is required for mrtg to work well. If you use SNMPV3 and other new features you should use at least 5.8. You can get the latest perl from http://www.perl.com/ MRTG generates traffic graphs in the PNG format. To be able to do this it needs several 3rd party libraries. When compiling these libraries I urge you to make sure you compile them as static libraries. There is just much less trouble ahead if you are doing it like this. See the Instructions in the next section for inspiration. Note that many free unices have all the required libraries already in place so there is no need to install another copy. To check it is best to skip all the library instructions below and go straight into the mrtg compile. If the first attempt fails and you do not get a working version of mrtg, try compiling new copies of all libraries as explained below. Do this BEFORE you send email to me about problems compiling mrtg. gd This is a basic graph drawing library created by Thomas Boutell. Note that all releases after Version 1.3 only create PNG images. This is because a) Thomas got into trouble because the GIF format which it used to produce uses a compression technology patented by Unisys. b) PNG is more efficient and patent free. MRTG can work with old and new version of the GD library. You can get a recent copy of GD from: http://www.boutell.com/gd/ libpng Is required by gd in order to produce PNG graphics files. Get it from: http://www.libpng.org/pub/png/libpng.html zlib Is needed by libpng to compress the graphics files you create. Get a copy from http://www.gzip.org/zlib And last but not least you also need mrtg itself. In case you have not yet downloaded it, you can find a copy on my website: http://oss.oetiker.ch/mrtg/pub LIBRARY COMPILATION
In this section I will give you step by step instructions on how to compile the various libraries required for the compilation of mrtg. Note that these libraries may already be installed if you have a *BSD or Linux system so you can skip recompiling them. The wget program used below is a simple web downloader. You can also enter the address into your netscape if you don't have wget available. First let's create a directory for the compilation. Note that this may already exist on your system. No problem, just use it. mkdir -p /usr/local/src cd /usr/local/src If you do not have zlib installed: wget http://www.zlib.net/zlib-1.2.3.tar.gz gunzip -c zlib-*.tar.gz | tar xf - rm zlib-*.tar.gz mv zlib-* zlib cd zlib ./configure make cd .. If you don't have libpng installed wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.40.tar.gz gunzip -c libpng-1.2.34.tar.gz | tar xf - mv libpng-* libpng cd libpng env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR make rm *.so.* *.so cd .. And now you can compile gd For versions up to 1.8.4, try: wget http://www.boutell.com/gd/http/gd-1.8.4.tar.gz gunzip -c gd-*.tar.gz |tar xf - rm gd-*.tar.gz mv gd-* gd cd gd The characters at the end of the following lines mean that all the following material should actually be written on a single line. perl -i~ -p -e s/gd_jpeg.o//g Makefile make INCLUDEDIRS="-I. -I../zlib -I../libpng" LIBDIRS="-L../zlib -L. -L../libpng" LIBS="-lgd -lpng -lz -lm" CFLAGS="-O -DHAVE_LIBPNG" cd .. For versions starting around 2.0.11, try: wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz gunzip -c gd-2.0.33.tar.gz |tar xf - mv gd-2.0.33 gd cd gd env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" ./configure --disable-shared --without-freetype --without-jpeg make cp .libs/* . MRTG COMPILATION
Ok, now everything is ready for the mrtg compilation. cd /usr/local/src gunzip -c mrtg-2.17.4.tar.gz | tar xvf - cd mrtg-2.17.4 If all the libraries have been preinstalled on your system you can configure mrtg by doing a simple: ./configure --prefix=/usr/local/mrtg-2 Otherwise you may have to give some hints on where to find the various libraries required to compile mrtg: ./configure --prefix=/usr/local/mrtg-2 --with-gd=/usr/local/src/gd --with-z=/usr/local/src/zlib --with-png=/usr/local/src/libpng If you have RRDtool available you might want to tell mrtg about it so that you can opt to use rrdtool with mrtg. Check mrtg-rrd. Configure will make sure your environment is fit for building mrtg. If it finds a problem, it will tell you so and it will also tell you what to do about it. If everything is OK, you will end up with a custom Makefile for your system. Now type: make This builds the rateup binary and edits all the perl pathnames in the scripts. You can now install mrtg by typing make install (requires gnu install) All the software required by MRTG is now installed under the /usr/local/mrtg-2 subdirectory. You can now safely delete the libraries we compiled above. Then again, you might want to keep them around so that you have them available when compiling the next version of mrtg. CONFIGURATION
The next step is to configure mrtg for monitoring a network device. This is done by creating an mrtg.cfg file which defines what you want to monitor. Luckily, you don't have to dive straight in and start writing your own configuration file all by yourself. Together with mrtg you also got a copy of cfgmaker. This is a script you can point at a router of your choice; it will create a mrtg configuration file for you. You can find the script in the bin subdirectory. cfgmaker --global 'WorkDir: /home/httpd/mrtg' --global 'Options[_]: bits,growright' --output /home/mrtg/cfg/mrtg.cfg community@router.abc.xyz This example above will create an mrtg config file in /home/mrtg/cfg assuming this is a directory visible on your webserver. You can read all about cfgmaker in cfgmaker. One area you might want to look at is the possibility of using --ifref=ip to prevent interface renumbering troubles from catching you. If you want to start rolling your own mrtg configuration files, make sure you read mrtg-reference to learn all about the possible configuration options. RUNNING MRTG
Once you have created a configuration file, try the following: /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg This will query your router and also create your first mrtg trafic graphs and webpages. When you run mrtg for the first time there will be a lot of complaints about missing log files. Don't worry, this is normal for the first 2 times you start mrtg. If it keeps complaining after this time you might want to look into the problem. Starting mrtg by hand is not ideal in the long run. So when you are satisfied with the results you can automate the process of running mrtg in regular intervals (this means every 5 minutes by default). You can either add mrtg to your crontab with a line like this: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * <mrtg-bin>/mrtg <path to mrtg-cfg>/mrtg.cfg --logging /var/log/mrtg.log or if you live in Linux Land the line may look like this if you are using "crontab -e" */5 * * * * <mrtg-bin>/mrtg <path to mrtg-cfg>/mrtg.cfg --logging /var/log/mrtg.log or like this if you use /etc/crontab */5 * * * * mrtg-user <mrtg-bin>/mrtg <path to mrtg-cfg>/mrtg.cfg --logging /var/log/mrtg.log You can also run mrtg as a daemon process by adding the line RunAsDaemon: Yes to your mrtg configuration file and then creating a startup script in your system startup sequence. Unfortunately, adding startup scripts differs widely amongst different unix systems. The modern ones normally have a directory called /etc/init.d or /etc/rc.d/init.d where you put scripts which starts the process you want to run when the system boots. Further you must create a symbolic link in /etc/rc3.d or /etc/rc.d/rc?.d called S65mrtg (this is just a sample name ... it is just important that it starts with S followed by a two digit number). If you are not sure about this, make sure you consult the documentation of your system to make sure you get this right. A minimal script to put into init.d might look like this: #! /bin/sh cd /usr/local/mrtg-2.17.4/bin && ./mrtg --user=mrtg-user /home/httpd/mrtg/mrtg.cfg --logging /var/log/mrtg.log Note that this will only work with RunAsDaemon: Yes in your mrtg.cfg file. AUTHOR
Tobias Oetiker <tobi@oetiker.ch> 2.17.4 2012-01-12 MRTG-UNIX-GUIDE(1)
All times are GMT -4. The time now is 12:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy