Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 26th, 2006, 11:55 AM
Christian Kirsch
Guest
 
Posts: n/a
Default Dev-C++ Error: "In file included from..."

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


  #2  
Old May 26th, 2006, 12:25 PM
Erik Wikström
Guest
 
Posts: n/a
Default Re: Dev-C++ Error: "In file included from..."

On 2006-05-26 13:47, Christian Kirsch wrote:[color=blue]
> 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...[/color]

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
  #3  
Old May 26th, 2006, 12:35 PM
mlimber
Guest
 
Posts: n/a
Default Re: Dev-C++ Error: "In file included from..."

Christian Kirsch wrote:[color=blue]
> 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[/color]

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

  #4  
Old May 26th, 2006, 01:55 PM
Christian Kirsch
Guest
 
Posts: n/a
Default Re: Dev-C++ Error: "In file included from..."

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

  #5  
Old May 26th, 2006, 01:55 PM
Christian Kirsch
Guest
 
Posts: n/a
Default Re: Dev-C++ Error: "In file included from..."

Hi mlimber,

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

Chris

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.