News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Autocompletion and open #include not working on single file

Started by juraj, December 14, 2011, 12:23:12 AM

Previous topic - Next topic

juraj

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?

ollydbg

QuoteIf 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.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Quote from: ollydbg on December 14, 2011, 05:38:58 AM
QuoteIf 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.

juraj

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.


stahta01

Quote from: juraj on December 14, 2011, 02:30:55 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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Because they think 10.05 is 'stable'  ;D

BTW. The new emoticons are pretty bad...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

juraj

Quote from: stahta01 on December 14, 2011, 04:59:17 PM
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.

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]