User forums > Using Code::Blocks

Bug in 'swap header / source'

<< < (2/9) > >>

stahta01:

--- Quote from: Zini on October 14, 2009, 10:39:00 am --- One *could* try to derive an algorithm instead for guessing the right file, but to me this sounds just lke asking for trouble.

--- End quote ---

The proper algorithm is the same one the Compiler Uses. Look for it the same way using the search directories from project settings.
Just it seems hard to do from my point of view.

Tim S.

oBFusCATed:
I would prefer a dialog, so I can choose the file I want

Zini:

--- Quote ---The proper algorithm is the same one the Compiler Uses. Look for it the same way using the search directories from project settings.
--- End quote ---

Sorry, that is not correct. The algorithm for choosing include files (I assume that this is the one you mean) is entirely useless here. IIRC if you have more than one header file with the same name in your collection of include paths, gcc usually picks the first one.

Zini:

--- Quote ---I would prefer a dialog, so I can choose the file I want
--- End quote ---

That might be an option, though it would not handle the case where the corresponding h/cpp file does not exist yet (the swap feature used to offer an option to create it in this case).

stahta01:

--- Quote from: Zini on October 14, 2009, 04:14:39 pm ---
--- Quote ---The proper algorithm is the same one the Compiler Uses. Look for it the same way using the search directories from project settings.
--- End quote ---

Sorry, that is not correct. The algorithm for choosing include files (I assume that this is the one you mean) is entirely useless here. IIRC if you have more than one header file with the same name in your collection of include paths, gcc usually picks the first one.

--- End quote ---

If the proper header file exists; it MUST use the same method. Or the solution is in-correct.
The problem is what to do if it does not exist.

Tim S.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version