User forums > Using Code::Blocks

In 2014, starting from default settings, clear steps to make only C code compile

(1/2) > >>

Howitzer 21:
It is September 27, 2014, and I re-installed Code::Blocks a few weeks ago.  I'm working pretty much exactly from the default, "normal" settings, and that includes using the GNU GCC Compiler to compile my projects.  That being said, what is a good, clear list of steps to make Code::Blocks only compile C code, instead of C++ code?

In other words, assuming this is still a syntactical feature of pure C, if I insert a blank space at the very beginning of a source file, I do not want it to compile.  I want gcc in Code::Blocks to behave exactly as a pure C compiler, and nothing more.

From what I understand, using .c for all the file extensions doesn't work, and though I would be tempted to use one of the answers here:

    http://forums.codeblocks.org/index.php?topic=15189.0;prev_next=next

I would prefer to first check and make sure.  Simply running tests isn't an accurate enough way to find out if one of the answers on that thread works, that thread's a few years old, and some of the answers are not completely specific.

Thank you.

stahta01:
Read the CB FAQs then ask a smart Code::Blocks related question.

CB FAQs http://wiki.codeblocks.org/index.php?title=FAQ
CB Rules http://forums.codeblocks.org/index.php/topic,9996.0.html

http://www.catb.org/esr/faqs/smart-questions.html

I have no idea what you are asking for; I suggest reading the links I have posted!

Tim S.

Howitzer 21:
Tim, I checked those links out, and I don't believe this goes against the rules or ignores the FAQ in any way.

My question is how do you take the current version of Code::Blocks and its default settings, along with the GNU GCC Compiler, and tell it to only compile and link everything as C, not as C++?

The only things I'm seeing on the Internet so far are things that I don't trust, and it only takes the allowance of one obscure C++-specific feature to make the compilation not C-specific.  That's why I'm asking here.

stahta01:
The only thing that really applies to Code::Blocks part of the answer is

Setting the CB Toolchain to NOT use the CPP compiler.

http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Compiler-neutral_setup_steps

The rest of your first post is NOT understandable!

They was NEVER a real C Compiler that did nothing because the source file had a space at the beginning of it!!

I have no idea if you know what a C Compiler is or what an IDE is.

Tim S.


edison:
Use .c as file extension.

Navigation

[0] Message Index

[#] Next page

Go to full version