News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Code Blocks not compling the code any other directory except in C Drive....

Started by shafique, November 04, 2008, 07:36:46 AM

Previous topic - Next topic

shafique

Dear friends
I am using Code block the latest version having memory space 19.3 MB,
I have one problem and please if any body know the solution of problem, do tell me. I will be thankful to him.....

The problem is
when ever I made any code in C ++, using its header files like iostream.h or iostream and using std::cout and other functions..........it didn't compile it and show errors that this header fine couldn't be found in directory.........

and if I save this code in program file where window is installed...this program not only compile successfuly but also run as well..........

but in any drive like D, E, F or any.......it doesn't compile the code........and display this message, that the iostream header file is not in the directory.........
I hope you got my point.......
thanks and regards

TDragon

Could you please enable full command-line logging and post the exact error messages?
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

shafique

1   //ye kia joke hai
2   #include <iostream>
3   using std::cout;
3   using std::cin;
4   using std::endl;
5
6   int main ()
7  {
8   cout<< "Yaar is ko compile ker day, na tang ker...." ;
9   return 0;
10  }

The errors ares


E:\code.c|2|iostream: No such file or directory|
E:\code.c|3|error: syntax error before "std"|
E:\code.c||In function `main':|
E:\code.c|9|error: `cout' undeclared (first use in this function)|
E:\code.c|9|error: (Each undeclared identifier is reported only once|
E:\code.c|9|error: for each function it appears in.)|
||=== Build finished: 5 errors, 0 warnings ===|


Now also plz listen this
I am having 4 drives of my Hard disk, named as C, D, E, F.........
I have made a folder named as myProgs in E drive..............the same code which is given above if I save it in Drive C furthur in Program file, the C::B compile it well, where as in any other drives it generates the errors which I have mentioned......................Now I hope you will understand completely

thanks and regards

MortenMacFly

Quote from: shafique on November 05, 2008, 05:22:13 AM
E:\code.c|2|iostream: No such file or directory|
This is not helpful. Please do what TDragon said and enable full command logging (see my sig). Then post the complete compiler log. Only the errors are of no help at all.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

thomas

Quote from: shafique on November 05, 2008, 05:22:13 AM
The errors ares

E:\code.c|2|iostream: No such file or directory|
E:\code.c|3|error: syntax error before "std"|
C != C++
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

shafique

I do all what you people say that......but mean I do change the settings in compiler and dibugger .........other settings.........and take inline the full command option....as you people told me..................but same results........same errors................

why it happens..........even if I make same code in C not C ++, it didn't generate in error......................why it do like this with only C ++????????????

TDragon

Code::Blocks and GCC expect (rightly!) that a file ending with ".c" will only contain C code. The code you've written is in C++; you should name the file ".cpp" (recommended), ".cc" or ".cxx".
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

shafique

hurrrrrrrrrrrahhhhhhhhhhh


yes it works ...................thanks very much.......


live you.............10000000000000000000000 years............thanks again