Eclipse CDT Custom Compiler Error Parsing Plugin - c++

I'm using an uncommon C compiler with Eclipse CDT. I have a make file setup which is nice, but I'd like IDE integration with the error / warning output of my compiler.
Does anybody know what steps I can take to write a plugin for parsing / supporting my compilers output? I think it should be easy but there is a barrier of entry of figuring out where to start. Would be nice if Eclipse would let me do New -> Compiler Error Parser Plugin, or something like that.
Thanks

It's not quite that simple...
First of all make sure you have the Eclipse PDE (Plug-in Development Environment) and CDT SDK installed. If not then you'll need to tell Eclipse to download them (Help -> Install New Software).
Then, create a new Plug-In project. In its Extensions tab, add a new extension against point org.eclipse.cdt.core.ErrorParser. You will then have to write some java code to actually implement it. Fortunately the PDE makes the meta-work relatively straightforward; you put the name of your class in the appropriate box and click on the "class*" hyperlink and it will offer to create a skeleton class for you.
I suggest you grab the source code to the CDT and have a look at GCCErrorParser.java as an illustration of the sorts of things yours will have to do.
Finally, when you're ready to test it, set up a debug configuration of type Eclipse Application. (This will spawn a second instance of Eclipse; it has to use a different workbench.) Go into the properties of your C project, Settings panel, Error Parsers tab and switch on your shiny new error parser.

In Eclipse CDT 7.0.1 it's pretty simple. Just add a new error parser
under Window -> Preferences -> C/C++ Build -> Settings
and add regular expression with 3 groups: filename, linenumber and error description.
For example, for Visual Studio compiler regexp will be:
(.*?)\((\d*)\)\s:\s(.*error.*)
$1 - filename
$2 - line number
$3 - error description

IBM has published a step-by-step guide to how you can write your own CDT parser, its available here
Relevant google search for future proofing should be:
https://www.google.com/search?q=ibm+eclipse+write+cdt+parser&oq=ibm+eclipse+write+cdt+error+parser

In CDT 7 there is going to be a regular expression error parser included which should make this sort of thing much simpler. There are some details on the faq.
CDT 7.0 won't be released until the end of June, but you could try milestone builds to see if it does what you want. These can be downloaded here. You'll need to have a matching milestone version of the eclipse platform too.

I am using this plugin:
http://www.isystem.com/downloads/downloads/204-Eclipse-Downloads.html

is this working ?
(.*)\((\d+)\)\s:\sError(.*)
file: $1
line: $2
desc: $3
.
srkos

In CDT 8 this functionality does not require a plugin. I have support for several compilers and build systems using simple regular expressions. See screenshot here. You can test the regexes directly in the console output before copying them to this dialog. If you need to move them between machines, the resulting parsers are stored in your workspace under .metadata/.plugins/org.eclipse.cdt.core

Related

Why can't i search for vs code extensions?

So i have fresh Manjaro installation and only software i have is ws code and some bloatware.
But when i want to search for extesions like C/C++ it find somethink but not what i need.
This is what i get
my output
what i want
I find something like product.json but i cannot find its location or anything.
I tried reinstalling... nothing.
Also I can't find it as .vsix file so i don't know what to do.
Search for solution on internet.
Kamen's answer explains it pretty well. However, there is a workaround. You can go to the browser marketplace and search for the C/C++ Extension Pack. On the right, under "Resources", there is a "Download Extension" link. It will download a vsix file which you can install in Code by searching for Extensions: Install from VSIX... in the command palette (ctrl + shift + p).
What you're using is Code - OSS and not VSCode; they're built from almost the same source except for the telemetry and the part that handles the marketplace (the latter being a proprietary component by Microsoft). As far as I know it's not possible to have VSCode's Marketplace working for another editor. Code - OSS relies on Open VSX Registry.
References:
Differences between Code OSS and Visual Studio Code
https://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code

Intellisense not working for C/C++ in Visual Studio code

So I have C/C++ by Microsoft extension installed but where auto suggestions and code-completions for other languages seem to be working perfectly,I am facing problem with C/C++
As I create a new file in C,there seem to be no autosuggestion.Even pressing ctrl + space says "no suggestions"
I have code runner extension installed.So what seems to be the problem?
Is Autocomplete enabled?
What is your Intelli Sense Mode?
Your System Include Path set correctly?
What is your Intelli Sense Engine?
Your Intelli Sense Engine Fallback?
last but not least: is there something to suggest?
I do not use code runner but is far i have seen, there too, are some paths to set, although i don't how they're related to each other.

View the source code C++ in Eclipse - Ubuntu environtment

I had loaded the project to Eclipse but when I open the .cpp file, it like to open a text file.
Anyone know how to display the code-view in eclipse?
Please support.
Thank you so much.
I cannot find C/C++ in Window -> Preferences
Then you have no CDT installed – I suppose you got the version direct from the initial download page, but that's actually the java package – there's a link 'download packages' below, where you would have found the C++ package. Not too obvious, admitted.
Never mind, you don't need to re-install: Help -> About will reveil you your installed version's name ('Kepler', 'Luna', ...); via Help -> Install new packages you can add CDT plugin to your installation. Select under work with your release version of eclipse repository, e. g. http://download.eclipse.org/releases/photon.
Minimally, you need: C/C++ Development Tools, other plugins might be useful, too, like standalone debugger, call graph visualisation, unit testing support, auto tools support (configure, make; especially under linux), possibly LLVM support (if you want to use clang compiler), ...
My issue had been fixed.
Just do below steps in ubuntu:
Go to
https://www.eclipse.org/cdt/downloads.php and download newest CDT(C/C++ Develop Tool) version.
Copy the download file
eclipse-cpp-2018-12-R-linux-gtk-x86_64.tar.gz
to your folder in Ubuntu.
Extract
eclipse-cpp-2018-12-R-linux-gtk-x86_64.tar.gz
Run execute eclipse file -> Done.

using legacy project in Eclipse

I wish to use "C" legacy project in the Eclipse. In the project it require "autoreconf
-vi" followed by "./configure" before make to start. My problem is I am not able to do "autoreconf -vi" and "./configure" from the eclipse.
Thanks
Arpit
You should try enabling the autotools features from the Eclipse Linuxtools Plugin: if you have CDT, the Linuxtools plugin should already be available in your eclipse environment. However, you need to enable features from it:
use the following menu: Help / Install New Software
in the search box type "linux", find the plugin and
check the box (+ OK)
finally select at least Linux "Tools/Autotools support for CDT" (also call graph, gcov, gprof, ltt could be interesting but not needed for your problem)
Note: if you do not already have the plugin available, detailed instructions with an update URL are available in the Linux Tools Project/PluginInstallHelp wiki page.
Once you have this plugin installed, you can:
Convert an existing project by: File / New / Convert to a C/C++ Autotools Project / Next / Next / Finish
Edit the project properties as needed: Project / Properties / Autotools / Configure Settings, e.g., to specify configure flags in the advanced tab, platform specifiers for cross compilation etc.
Hope it'll help.
Cheers,
Christophe.
= They did not know it was impossible, so they did it! --Mark Twain =
The use of "autoconf" and similar hacks is no longer required. They were needed to port C code to platforms that failed to properly support ISO C89, but did made a reasonable attaempt. We're 21 years later and such systems are quite rare.
So, you should check for the use of Autoconf macros and remove those.
Scrapping ./configure might be harder, but it's also possible you might not need it at all - it could exist only as a result of autoconf.

What plugins do you use along with Eclipse CDT?

Suggest some plugins you find useful in your day by day work.
Eclipse CDT repositories:
Helios: http://download.eclipse.org/releases/helios
C++ Development Tools: http://download.eclipse.org/tools/cdt/releases/helios
Plugins:
Subclipse: http://subclipse.tigris.org/update_1.6.x
Eclipse Linux Tools: http://download.eclipse.org/technology/linuxtools/update
CMakeBuilder: http://www.cmakebuilder.com/update
CMake Editor: http://cmakeed.sourceforge.net/updates
Qt Eclipse Integration: Installation instructions link
Eclipse CORBA Plugin: http://eclipsecorba.sourceforge.net/update
Please add one plugin with its eclipse update url for posting.
I am using
Qt plugin for Eclipse
CMakeEdit for colorful CMakeLists.txt ;-)
Subversion (tried subversive, didn't work for me)
tried the linuxtools plugins (very ambitious project) for valgrind etc., but they are not
really working ATM
I use a self-made plugin to do automated builds of CDT projects.
THis plugin is automatically creating a workspace from a description file that contains the project names, disables the indexer and auto-build, sets the wanted build configuration in all projects and then builds the temporary workspace.
I use viplugin to get vim keybindings in Eclipse.
EGit - it's definitely helpful although I still do a fair amount of gitty stuff on the command line (and EGit stays in sync with changes I make on the command line, of course).