Christian Kirsch wrote:
Hi folks,
i use dev-c++ as my favourite development environment but i have some
little problems. I wrote a include file called ppmimage.h and now i
tried to implement it into the main file the following way:
#include "ppmimage.h"
When i start to compile the program i get the error: 1 "included from
main.cpp"
It doesn't work when I leave the .h, too. Then I get the message "No
such file or directory"
The second way to include the file with < >, also returns the same
messages. All the paths are correct in the project-options, i also
added the project directory to the include paths, the error remains...
Any ideas?
Thanks!
Chris
You should use quotes around your headers as angle brackets are for
standard headers, and you'll need to include the real name of the file
-- e.g., if it is called foo.h, you must use '#include "foo.h"'. (The
business with dropping the .h extension has to do with a change in the
C++ standard where the headers were renamed from, e.g., iostream.h to
just plain iostream. The former are deprecated and should not be used,
while the latter put all the identifiers in the std namespace.)
Other than that, this is not a C++ language issue, and your problems
are most likely the result of user error. You may have misspelled the
file name or path, for instance. If you can't figure out the error,
you'll want to ask on a group dedicated to your environment since this
group deals only with the C++ language proper, not configuration of
arbitrary development environments. See this FAQ for what is on-topic
here and for some suggestions of where else you might try posting:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Cheers! --M