Code::Blocks Forums

User forums => Help => Topic started by: juraj on December 14, 2011, 12:23:12 am

Title: Autocompletion and open #include not working on single file
Post by: juraj on December 14, 2011, 12:23:12 am
Okay, I pretty much said the whole thing in the subject. If I open a single .cpp file (not a project) in Code::Blocks, I can compile and run it, but code completion and opening #included standard header files doesn't work. Opening fails with ""Warning: Not found: iostream" (for example). Can I set the standard c++ library directory to be searched globally, without the need for a project?
Title: Re: Autocompletion and open #include not working on single file
Post by: ollydbg on December 14, 2011, 05:38:58 am
Quote
If I open a single .cpp file (not a project) in Code::Blocks, I can compile and run it
Really? I don't think you can. Codeblocks need a project (cbp) to build and run.

Can you give us some information like: OS, C::B version, Or you code snippet, Compiler version....
Or tell us the steps to reproduce your bug.
Title: Re: Autocompletion and open #include not working on single file
Post by: Jenna on December 14, 2011, 08:55:09 am
Quote
If I open a single .cpp file (not a project) in Code::Blocks, I can compile and run it
Really? I don't think you can. Codeblocks need a project (cbp) to build and run.

No you don't.
A single file is compile dwith the default compiler, just debugging does not work.
Title: Re: Autocompletion and open #include not working on single file
Post by: juraj on December 14, 2011, 02:30:55 pm
As Jens has already said, compiling and running does indeed work for single files. It's very useful for educational type programs, which are typically short but numerous and it would be an inconvenience to have to create a new project for each one. And it would be nice to have code completion, opening header files and debugging (as Jens noticed, and I agree) working for single files.

I am using the latest stable version. Steps to reproduce? Well, open a hello world .cpp and try to right click and open <iostream>. Also notice that code completion for standard library classes doesn't work, and that the debugging commands are grayed out.

Title: Re: Autocompletion and open #include not working on single file
Post by: stahta01 on December 14, 2011, 04:59:17 pm
I am using the latest stable version.

Why are there so many people who answer the version number question without giving a version number!!

Tim S.
Title: Re: Autocompletion and open #include not working on single file
Post by: oBFusCATed on December 14, 2011, 05:12:08 pm
Because they think 10.05 is 'stable'  ;D

BTW. The new emoticons are pretty bad...
Title: Re: Autocompletion and open #include not working on single file
Post by: juraj on December 15, 2011, 08:45:38 am
Why are there so many people who answer the version number question without giving a version number!!

Way to be polite and helpful.

BTW I'm using 10.05 if it's not already obvious.
Title: Re: Autocompletion and open #include not working on single file
Post by: MortenMacFly on December 15, 2011, 09:21:37 am
BTW. The new emoticons are pretty bad...
Hopefully you'll like the new ones...  ;)