Advertisement

how do I include my own header file?

Started by May 05, 2001 01:23 PM
5 comments, last by ManaStone 23 years, 9 months ago
Whenever I try to add a headerfile it keeps saying that no such file or directory exists. Even when it is in my project folder and added in my workspace. Do I have to add it to my settings or something?
-----------------------------Download my real time 3D RPG.
make sure you use:

#include "myfile.h"

instead of

#include

Advertisement
dammit. The gist of it was to use quotes instead of greater/less than sign around your include file. I guess I need an escape char to get it to draw the greater/less than sign in these messages.

Use < and > to get less than and greater than signs, respectivly, to appear in your message. I used & to get the ampersand to show up.

Resist Windows XP''s Invasive Production Activation Technology!
http://druidgames.cjb.net/
I did use quotes. It works if type in the entire directory path, but not when I just to the "file.h". But when I created an empty project and added the source code from a cd from my book, it would allow me to just type "file.h"
-----------------------------Download my real time 3D RPG.
Ok, when you use #include "file.h", file.h has to be in the same directory as the file that has that line in it, like main.cpp or something. If the file you are writing is on your hard-drive, say in C:\programming\main.cpp and you want to include D:\file.h, you would have to type #include "D:/file.h" but if file.h was in C:\programming\file.h, you could just type #include "file.h".

Hopefully that helps more than it confuses
Spanky
Advertisement
Thanks, just got it working.
-----------------------------Download my real time 3D RPG.

This topic is closed to new replies.

Advertisement