Solved

simple makefile question

Posted on 2006-11-21
1
221 Views
Last Modified: 2012-05-05
Hi

I have the following structure:
mydir/inc  - has one.h two.h
mydir/src  - has myfile.cpp
mydir/output - that's where makefile is

myfile.cpp begins with
#include "one.h"
#include "two.h"

The problem with the makefile I wrote is that g++ tells: one.h no such file or directory
when I change myfile.cpp
"#include "../inc/one.h" the problem dissapears.
How do I solve the problem without changing myfile.cpp?

thnx
0
Comment
Question by:ole111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
xRalf earned 50 total points
ID: 17988612
Hi,
try to use the parameter of preprocessor -I (e.g. g++ -I directory_for_headers)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question