| creating C source file in Java project [message #1726281] |
Thu, 10 March 2016 22:32  |
Eclipse User |
|
|
|
|
The description states the goal. I am running Mars.1, CDT 8.8.1.201602C on Fedora 23. I need to create C source files. I would prefer to put them into a separate folder/directory from the Java files. I initially tried to create the C source in the Java folder, but couldn't enter an acceptable source folder. In the project explorer window, I have created a native source folder under the project src directory, then R-clicked on that folder to create a C source file. The C file create dialog has an edit field 'Source folder' but I can't get anything to work. No matter what I type in, a message displays that the folder does not exist. Yes, I entered the folder name that I created. I tried a fully qualified name from '/'. I tried putting the folder name in from of the source file name but that didn't work. The finish button is not enabled until I enter a proper folder (it seems), so I can't complete creating my C source. I have checked and there is an empty directory with the folder name that I entered. What do I enter for the source folder? TIA, Chuck Crisler
|
|
|
|
|
| Re: creating C source file in Java project [message #1726615 is a reply to message #1726412] |
Tue, 15 March 2016 02:48  |
Eclipse User |
|
|
|
Quote:It seems (though I am not 100% sure) that the environment does support C
Yes, if you have CDT installed, any project can have a C file that the syntax is highlighted for. If you want advanced features you need the CDT nature on your project. (The inverse applies too, if you have a C project and put a .java file in it, you get syntax highlighting, but no advanced features like code navigation.)
Of course, if you are not an Eclipse developer, you may not know what a "nature" is. A nature is kind of like a project type, and one of the powers of Eclipse is any project can have multiple natures, and therefore support many languages in one go.
However, the flow can be imperfect workflow. To add a CDT nature you need to use the File -> New -> Other -> C/C++ -> Convert to a C/C++ Project (Adds C/C++ Nature) and follow the wizard.
Once you do that you can create a C source file with the wizard and features like indexer/etc will be supported.
|
|
|
Powered by
FUDForum. Page generated in 0.04373 seconds