Sublime Text - How to turn on diagnostics - c++

How can I enable such diagnostics as in the screenshot? This works while writing code.

Sublime Text doesn't have such diagnostic capabilities out of the box, since as the name suggests it's a text editor and not an IDE.
Regardless of that, the LSP package allows you to leverage the same lsp backend intelligence that products such as Visual Studio Code and similar use, and it has the ability to provide such diagnostics.
Since LSP is just a protocol that allows the editor to interface with external processes that are more specialized to the particular language/environment/tooling required for tasks, the LSP package itself is just the interface, and you also need to install an appropriate server.
In your case if you want to use it with C/C++ then you want to use something like clangd; there is documentation availble for how to setup C/C++ for LSP that you can refer to for the details.

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

How to set up documentation snippets in Eclipse?

I'm using Eclipse Neon with C++ developer tools installed. Normally I work on Visual Studio + Visual Assist Plugin. Visual Assist has a feature called snippets, which I use to bind a shortcut key to "document a method", which essentially just applies a documentation header template to the top of the function I had selected. Example:
void MyTestFunction();
No documentation block on this. I can put my caret on MyTestFunction and execute my shortcut key, and it will insert a documentation block above it (I define this myself):
///////////////////////////////////////////////////////////////////////////////
///
///////////////////////////////////////////////////////////////////////////////
void MyTestFunction();
I can then fill in documentation using doxygen-style syntax.
I have read a few posts on SO and elsewhere on templates, enabling doxygen support, etc. But I have yet to find something that will allow me to use a shortcut key to add documentation like this OR some type of auto-complete behavior like inserting 3 slashes (///) and pressing ENTER to insert the block above.
Can someone help me figure out a way to do this in Eclipse in a way that is similar to the Visual Studio + Visual Assist method?
There are lots of Doxygen setup manuals for Eclipse.
You can refer to this manual: Doxygen+Graphviz setup in Eclipse
Briefly your steps are:
Install Eclipse plugin: Eclox
Activate Doxygen documentation tool here: Window->Preferences->C/C++->Editor->Documentation tool (you may have to activate advanced view of Eclipse preferences)
After that you can type /** above any function and hit Enter

xilinx xps using command line mode

I am currently working with the Xilinx Platform Studio(XPS) tool to make an automated design with command line tools (without using GUI). I know how to build project using XPS in GUI mode, but don't know how to build a project with command line tools. I got some information about the command line tools usage from the "Embedded System Tools Reference Manual" and the "Command Line Tools User Guide".
But, I didn't get any information about following things:
How to select Bus interconnect type.
How to select Clock
How to select processor
How to select BRAM memory
How to make signals external
How to import our peripheral
How to select address
I did all the following steps in XPS command line
Creating a new .xmp project
Adding architecture, device, package speed
Language setting,simulation setting
loading ucf file
I don't know how to add peripheral, processor and interconnect bus type.
I am struggling at this stage only - I know how to synthesize, implementation, and Bitfile generation.
If anybody knows information about these things using command line tools or any documents, Kindly reply to this post
I am afraid I do not know how to do this in XPS, but with Vivado all of these actions may be done via Tcl commands. Vivado works so much better than XPS. Unfortunately, Vivado does not support older Xilinx devices, so this may not be an option for you.

how to create installer file

I am currectly finishing my project in C++ and i'm looking for a way to create my own C++ installer file
which will create the project dll's and exe files into a specific path
what is the easier way to learn how to do it?
There are several ways to build an installer. While you can of course always make one yourself, you should google for something like "create an installer". Some prebuilt solutions include "InstallShield", or the ".msi" file format, which you can create on your own using something like "Advanced Installer".
Of course, if you want your users to build your project from source, then you need a makefile and to make sure you bundle all the libraries. There are also kits like autotools to do that for you.
If you use VS 2010, Installshield LE would suffice as it is integrated into VS 2010.
If you have access to Installshield IDE, there is nothing better available for your packaging needs.
There are two ways of packaging:
a) The LEGACY way
b) The Windows Installer way, Basic MSI is the keyword here.
The LEGACY way involves creating your own scripts for:
a) Installing the files to their locations
b) Writing registry entries, if needed
c) Registering COM components, if needed
d) Creating shortcuts etc...
Tools that can be used for LEGACY approach are:
a) NSIS - very good and has a scripting language of its own.
b) Installshield - has a project type called Installscript Project. Installscript is the scripting language to be used.
The Windows Installer way is a bit hard comapred to the LEGACY way.
One has to learn the basics of MSI technology which can be daunting.
The package created has .msi as extension. This file is a database that the developer configures and the Windows Installer takes care of all other things. This is called TRANSACTIONAL installation procedure.
Even the UI presented during install is configured in the Database using tables like Dialog, Controls etc...
Tools that can be used for Windows Installer approach are:
a) Installshield - has a project type called Basic MSI
b) Wix - Opensource and xml based. You configure appropriately named xml files and various utilities in the Wix package will help you to create an MSI package.
First after completing your project click save. Second click on file tab,Add,New Project.
In new Project Click other Project types , Setup and Deployment and in that You can click InstallShield LE or Visual Studio Installer.
Hope this Helped you
I always recommend NSIS. You might also investigate HM Nis Edit - it's an IDE for NSIS that has a useful wizard feature. It will generate an installer script for you which you can further customize. The documentation is extensive.
can't believe no one mentioned install creator pro(there is also a free version with a branded message that displays after installing). Its feature set is pretty limited, though it has options for writing registry values and specifying custom paths to %AppData% or any other place you may want to install some files. it also has an optional wizard interface, and with each step you have the oppurtunity to preview each individual page.
the paid version offers the option for adding serial number/registration to your program. i've never tried it so i'm not sure how effective it may be. its also quite and expensive little program, but i would recommend it atleast to the beginner or someone who is more concerned with maintaining the codebase of their program and less concerned with how fancy and decorated their installer program is.
i know its been a long time since this was posted but for future reference this program is far easier for any beginner to creating installation packages for the first time

Eclipse CDT Custom Compiler Error Parsing Plugin

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