Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: Alturin on May 21, 2007, 09:15:42 pm
-
Steps to reproduce:
Create a new C project (not C++).
Create a new header file.
Right click and click "Swap header/source"
When a .c file should be created, instead a .cpp file is made.
This turned out to be a very annoying 'bug' for me to trackdown, because the compiler kept telling me about undefined functions, which I was sure were in the according .c file (which turned out later was a .cpp file!).
Is this an actual bug, or intentional?
Thank you for your time,
Alturin.
-
Create a new C project (not C++).
Creating a C project doesn't ensure that all the files will be C file. That option is asked to copy the respective sample code during project creation.
-
Is it possible to add an option somewhere in the "Create new file" dialog?
Cos at the moment I have to "rename file", "remove file from project", "add file to project" in order to fix it to it being a proper C file again.
-
Is it possible to add an option somewhere in the "Create new file" dialog?
Ctrl+Shift+N
-
Is it possible to add an option somewhere in the "Create new file" dialog?
Ctrl+Shift+N
I mean the dialog you get after you hit "Swap header / source" -> "Error: The file does not exist. Do you want to create it?" -> Yes -> "Do you want this new file to the active project?" -> Yes -> "Select all" -> Ok.
Somewhere in that chain, there might could be an option "Create as CPP file / Create as C file"?
-
Use File > New > File... and then select C/C++ Source option.