By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,409 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Dev-C++ Error: "In file included from..."

P: n/a
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

May 26 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 2006-05-26 13:47, 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...


Could you paste the code (or parts of it) and the full error message?
It seems to me that the message is something like "error in file
included from main.cpp" which would mean the there is something wrong
with your .h-file.

The correct way to include a file is just as you have done #include
"file.h", using the < and > is for including parts of the standard library.

Erik Wikström
--
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure
out how to use my telephone" -- Bjarne Stroustrup
May 26 '06 #2

P: n/a
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

May 26 '06 #3

P: n/a
Hi Erik,

thanks for the quik answer, and you were right. There was an syntax
error in the h-file, which i didn't recognize because I tried to solve
the first error-message which was the, in my opinion "strange" one. Now
it works...

have a nice day...!
Chris

May 26 '06 #4

P: n/a
Hi mlimber,

no, the problem was more simple: just an error in the h-file. Thanks
for your help!

Chris

May 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.