Author Topic: problem, with including .h  (Read 9104 times)

Offline artaban

  • Single posting newcomer
  • *
  • Posts: 7
problem, with including .h
« on: November 14, 2005, 09:22:15 pm »
Hi, I am a beginner in C++,
I learn C++ at school, and we works with Anjuta, I found C::B is really pretty good for cpping on windows.

So, At school, we make some file .h,
but with place these in the 'sources' section NOT in 'headers'.
And we include like this : #include "lol.h"

So, in CB, when i make a .h, the file is automatically placed in "headers" section, and with #include "lol.h", I took these errors

C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/cwchar:146: error: `::fgetwc' has not been declared
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/cwchar:147: error: `::fgetws' has not been declared
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/cwchar:148: error: `::fputwc' has not been declared
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/cwchar:149: error: `::fputws' has not been declared
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/cwchar:150: error: `::fwide' has not been declared
And so many others ....

Please, can someone tell me if im going on the wrong way or a solution to solve my problem..
Sorry worse English blablablabla....

Thanks

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: problem, with including .h
« Reply #1 on: November 15, 2005, 01:32:21 am »
"Section" probably means "folder"? That does not matter, you only have to add that folder to the compiler's include directories (in "Build options", under the tab "Directories").

The error messages that you have posted do not really tell an awful lot (it might help to know what exactly you are doing, i.e. what files are where, and what is in them (what do you include, for example, or what do you intend to do). Apparently there's something screwed up with standard input/output there).

Installing MinGW (or Code::Blocks with MinGW included) in a path that contains spaces (such as Program Files) is generally a bad idea. Although it is likely not the cause of your problem here, it is certain to cause you headaches any time later (for example when you want to debug or use the resource compiler). Better install the compiler so that there are no spaces in the path.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline artaban

  • Single posting newcomer
  • *
  • Posts: 7
Re: problem, with including .h
« Reply #2 on: November 15, 2005, 09:41:07 pm »
thomas, you are GREAT :D,

Right, the error was caused by being in "c:\program files\",
i guess space caract bugged the program.

Of course the idea to add my project directory in 'directories' of build, has worked too :)

But i wondering, how to ask CB to make my current project directory a directory for the compiler, such as i make this screenshot :
http://img15.imageshack.us/my.php?image=screenshot7bq.jpg

EDIT: oups lol, that was infact, c:\codeblocks\projects\$DIR
simple as well, have a nice day guys, no more problem at this time ^p^p
« Last Edit: November 15, 2005, 09:52:36 pm by artaban »