I wonder if you can tell me the path make command uses to search for libraries and header files, I'm getting these errors posted in my question and I wanna check the path manually.

I have Ubuntu 12.04 LTS, 2.6.38-16 kernel and gcc version 4.6.3 and I'm trying to compile this package:


Thank you.

  • 1
    make usually searches the working directory for a file called makefile and executes it. Check inside there for clues and update your post with the contents if you're still not sure :)
    – Hugo Buff
    Mar 13, 2014 at 12:26

1 Answer 1


The make command itself does not search for libraries or header files - instead it looks for a Makefile in the current directory (unless an alternative file is specified on the command line using the -f option) and executes the instructions inside. Those are usually instructions to specific compilers such as gcc and/or g++.

The Makefile may add search paths for specific compilation commands using -I (for include files) and/or -L (for libraries) directives. You can find the default search paths in your compiler documentation e.g. GNU gcc: Search Paths or you can list them directly by processing an empty file with compiler verbosity turned up e.g. to see what the gcc include path is

echo | `gcc -print-prog-name=cc1` -v

or to see both include and library path information echo | gcc -xc -E -v - (for C) or echo | gcc -xc++ -E -v - (for C++).

However the question you linked to looks like the output from a ./configure script rather than from a make command. A ./configure script is part of the GNU automake system and is used to create a 'custom' Makefile for the local build environment by figuring out where various components are located on your system. If you have libraries located in non-standard locations, such as other build dependencies that you have also built from source, and installed somewhere like /usr/local/, then it may be necessary to pass those locations to the ./configure script e.g.

./configure --with-foo=/usr/local --with-bar=/opt/bar_3.14

For specific instructions you will need to refer to the README or similar documentation for the package you are trying to build.

  • Thank you for the informative answer. I listed the default search paths using your command and copied a ioccom.h file to one of the paths and that didn't work.
    – loo3y35
    Mar 15, 2014 at 10:25
  • After that I looked at the MakeFile and the Rules.mk (the make file asks to include Rules.mk). I found this line "INCLUDES = -I. -I$(TOP)/src/sysinclude -I$(LINUXROOT)/include \ -I$(PCAP) -I$(CAP) -I$(PCAP)/bpf -I$(PCAP)/lbl" I copied the header file to (TOP)/src/sysinclude and that didn't work...still getting checking sys/ioccom.h presence... no
    – loo3y35
    Mar 15, 2014 at 10:29
  • I don't mind adding the missing files manually if there is a way or modifing the ./configure script to include them but I couldn't find it..I only issue the make command and I think it runs ./configure automatically
    – loo3y35
    Mar 15, 2014 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.