Click here to Skip to main content
11,798,866 members (73,334 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VC10.0
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
Edited 19-Nov-10 14:51pm
Dalek Dave433.2K

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
0 CPallini 505
1 OriginalGriff 503
2 Richard MacCutchan 321
3 Maciej Los 245
4 phil.o 244
0 OriginalGriff 2,270
1 Maciej Los 1,810
2 KrunalRohit 1,496
3 CPallini 1,425
4 Richard MacCutchan 1,109

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 19 Nov 2010
Copyright © CodeProject, 1999-2015
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