Click here to Skip to main content
13,191,400 members (80,970 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am using #include "john.h". which is in the c:\ directory how do I get the main program to use this header file?
// john.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include "john.h"

int _tmain(int argc, _TCHAR* argv[])
    return 0;

Error: Cannot find source file john.h

where do I put john.h so it will find it.

Posted 19-Nov-10 14:19pm
Updated 19-Nov-10 14:51pm
Dalek Dave433.3K

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

put "john.h" in the same directory as your project. I'm not sure, but if you wanted to include a header from the c drive root, then you could (maybe) put something like
#include "c:\header.h"

again, I'm not sure about that one.

Just a note, generally you use <> for global includes and "" for local, project specific ones.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171017.1 | Last Updated 19 Nov 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100