Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » using cxxSource handler for all *.c file type
using cxxSource handler for all *.c file type [message #714701] Thu, 11 August 2011 10:03 Go to next message
hp tf is currently offline hp tfFriend
Messages: 6
Registered: August 2011
Junior Member
Hello all,

Summary: how to change default file type (locked) for *.c file to cxxSource, without breaking refactoring in latest CDT Indigo ?


I am working on a *big* project were all files (c and C++) are name *.c *.h.
By default eclipse is defining cSource as the type for *.c; that trigger millions of syntax error.

STOP: its not possible to change the files extension given the history, multi countries team, and the number of files involves in this project !!! ( I am very sorry for that)

I use, in the past, to edit de plugin.xml of the code.cdt. Its maybe ( very)) nasty but its work:
unzip -x plugins/org.eclipse.ltk.ui.refactoring_3.6.0.v20110505-0800.jar plugin.xml 
vi +394 plugin.xml 
zip -f plugins/org.eclipse.ltk.ui.refactoring_3.6.0.v20110505-0800.jar plugin.xml 
eclipse -clean ...


However this trick is not working anymore with indigo, breaking the 'refactoring' functionality, which I need .


Do you have any clue to
- do the trick in a cleaner way (note renaming file to .cpp is NOT an option)
- fix the re factoring even with the trick
- another way to achieve the result ( see *.c as cxx not c)


Thanks in advance for your help

NOTES:
- the refactor does nothing ( I see sometime Conflict problem in the error log )
- the trick consist in replacing "c" extensions into "cpure" and "h" in "hpure" for cSource file; c and h are already in the list of extensions for cxxSource/cxxHeader


Re: using cxxSource handler for all *.c file type [message #715032 is a reply to message #714701] Fri, 12 August 2011 07:41 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Quote:
how to change default file type (locked) for *.c file to cxxSource

Project Properties->C/C++ General->File Types
Here you can overwrite the default binding of *.c to C.

If it breaks the refactoring then you should open a bugzilla report.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: using cxxSource handler for all *.c file type [message #718960 is a reply to message #715032] Thu, 25 August 2011 16:37 Go to previous message
hp tf is currently offline hp tfFriend
Messages: 6
Registered: August 2011
Junior Member
Quote:

Project Properties->C/C++ General->File Types
Here you can overwrite the default binding of *.c to C.


This is not working
I can only 'add' mapping, but cannot change system one
If I add *.c -> C file mapping, it seems to not being taking into account

How to reproduce: just rename a C++ file into myfile.c and try to open it
(one typical think to have problem is to put a 'namespace' directive in your file)

Do I miss something ? if not, I will fill a bug .... ( but I prefer someone else to check that the problem is not only me before (this should be easy, as only temporary renaming of a file raise the problem))

any one to confirm the problem, if this is the way to configure *.c as c++ file ?

(Note: thus I cannot check more the refactoring problem)
hp tf
Previous Topic:SIGSEGV causes eclipse CDT to crash at startup - (HotSpot Virtual Machine?)
Next Topic:Main file not found when importing a cpp file to understand simulation
Goto Forum:
  


Current Time: Sun Sep 22 11:02:38 GMT 2024

Powered by FUDForum. Page generated in 0.03756 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top