User forums > General (but related to Code::Blocks)

error: Text.h: No such file or directory

(1/2) > >>

prawnhead:
Apologies if you've seen this complaint a hundred times.

* I've just installed Code::Blocks
* I installed it with MingW
* I'm using it for the first time
* I created a console app
* I added a new class called Text (with defaults)
* I hit "build"
* It threw a list of errors:
--- Code: ---||=== Test99, Debug ===|
D:\Users\prawnhead\Documents\C++\Test99\src\Text.cpp|1|error: Text.h: No such file or directory|
D:\Users\prawnhead\Documents\C++\Test99\src\Text.cpp|3|error: 'Text' has not been declared|
D:\Users\prawnhead\Documents\C++\Test99\src\Text.cpp|3|error: ISO C++ forbids declaration of 'Text' with no type|
D:\Users\prawnhead\Documents\C++\Test99\src\Text.cpp||In function 'int Text()':|
D:\Users\prawnhead\Documents\C++\Test99\src\Text.cpp|6|warning: no return statement in function returning non-void|
D:\Users\prawnhead\Documents\C++\Test99\src\Text.cpp|8|error: expected constructor, destructor, or type conversion before '::' token|
D:\Users\prawnhead\Documents\C++\Test99\src\Text.cpp|13|error: 'String' does not name a type|
||=== Build finished: 5 errors, 1 warnings ===|

--- End code ---
Pardon my stupidity, but how does a file that Code::Blocks just created for me not exists? Thanks for any help.

Jenna:
It surely exists, but if you create the new class, you can decide where the files get created (or whether they should be in the same directory).
The class-wizard does not automatically add the folder the header is in to the include-dirs of the project, so you have to do it yourself.

prawnhead:
Thanks Jens. Where are the include-dirs? (And why aren't additional files added by default?) Is there a tutorial? Can't find anything for Windows. Thanks.

MortenMacFly:

--- Quote from: prawnhead on February 16, 2011, 11:24:34 am ---Where are the include-dirs?

--- End quote ---
How should we know? It's your project / your directory layout. :?


--- Quote from: prawnhead on February 16, 2011, 11:24:34 am ---(And why aren't additional files added by default?)

--- End quote ---
Because there are many cases where you don't want that.


--- Quote from: prawnhead on February 16, 2011, 11:24:34 am ---Is there a tutorial?

--- End quote ---
Tutorial on what exactly? How you add include dirs to compiler options? Try the C:B manual here:
http://www.codeblocks.org/docs/main_codeblocks_en.html

prawnhead:
Morten, wow. You sure know how to encourage the noobs. Bye.

Navigation

[0] Message Index

[#] Next page

Go to full version