Thread: Problem with Makefile

  1. #1
    Registered User
    Join Date
    Jan 2014
    Posts
    2

    Problem with Makefile

    Hi Everyone,
    I am new to c++ programming I got a full code in c++ with a Makefile. In Makefile i have to use header files which are in a sub directory in the directory I am working. Like I am working in PEM directory and src directory is in PEM and I have header files in src. So to include this src directory in makefile i am using the command
    CPPFLAGS = -I../src
    now if i compile makefile then it gives me an error like
    IoSimple.h: No such file or directory
    but this header file is in src i ahve checked it by listing files.
    Can anybody help me i think so i am not properly mentioning the path to include the src directory???

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Two dots goes up a directory. This would make src a sibling directory to where you are, rather than a subdirectory.

  3. #3
    Registered User
    Join Date
    Jan 2014
    Posts
    2
    Thanks for your reply so what you suggest what should I used now rather than above mentioned statement??

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    A single dot means current directory for the OSes I know about.

    Tim S.

    Code:
    CPPFLAGS = -I./src
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MAKEFILE problem (help!!)
    By zhok in forum C Programming
    Replies: 6
    Last Post: 05-20-2010, 08:13 AM
  2. Makefile problem
    By Furious5k in forum C++ Programming
    Replies: 2
    Last Post: 04-18-2009, 10:07 AM
  3. Makefile Problem
    By jerryyyyy in forum C++ Programming
    Replies: 8
    Last Post: 11-27-2008, 07:22 PM
  4. Makefile problem
    By TriKri in forum Windows Programming
    Replies: 8
    Last Post: 06-26-2008, 11:06 AM
  5. Problem with makefile, how to use the -lm oh this?
    By Nazgulled in forum C Programming
    Replies: 1
    Last Post: 04-07-2006, 01:29 PM

Tags for this Thread