Author Topic: Bug? Swap header/source -> file does not exist yet  (Read 11205 times)

Alturin

  • Guest
Bug? Swap header/source -> file does not exist yet
« 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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Bug? Swap header/source -> file does not exist yet
« Reply #1 on: May 21, 2007, 09:28:43 pm »
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.
Be a part of the solution, not a part of the problem.

Alturin

  • Guest
Re: Bug? Swap header/source -> file does not exist yet
« Reply #2 on: May 22, 2007, 01:50:13 am »
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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Bug? Swap header/source -> file does not exist yet
« Reply #3 on: May 22, 2007, 08:47:52 am »
Is it possible to add an option somewhere in the "Create new file" dialog?

Ctrl+Shift+N
Be patient!
This bug will be fixed soon...

Alturin

  • Guest
Re: Bug? Swap header/source -> file does not exist yet
« Reply #4 on: May 22, 2007, 08:46:32 pm »
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"?

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Bug? Swap header/source -> file does not exist yet
« Reply #5 on: May 22, 2007, 09:06:57 pm »
Use File > New > File... and then select C/C++ Source option.
Be a part of the solution, not a part of the problem.