CLion syntax error issues with opencv/armadillo - syntax-highlighting

I am using CLion to do C++ development on Mac OS. It's a great IDE with many cool features, but I find the syntax error highlighting feature doesn't work well with matrix libraries like armadillo/opencv.
I installed the libraries via brew, and I am using Apple clang toolchain. However, CLion is showing too many distracting syntax errors incorrectly, even though the program compiles perfectly fine with cmake. Is there a way to solve this issue?
Below is a screenshot of the one of the "errors":
It's a perfectly ok opencv mat constructor with MatExpr, but somehow CLion doesn't find the right function defintion.
I can provide more details if needed. If nothing else works, I think a way to quickly toggle showing/hiding the errors would work for me as well, but I haven't figured that out yet either.
Thanks in advance!

Related

Where to find GLSLEditorSample (GLSL IDE)?

Currently I'm doing some GLSL-stuff and to my surprise I cannot find a reasonable IDE for this (MacOS). Nothing to fancy, but just a way to change the code and see the results. I know of the Shadertoy-website, but I'm more interested in an offline solution.
So I came across the built-in OpenGL Shader Builder. According to Wikipedia, this is deprecated and superseded by GLSLEditorSample, which should still be available as an example project for XCode (of which I have version 7.3.1 installed). However, I basically cannot find anything about this, online nor on my computer. Therefor my question: Is this still relevant? If so, where is it located?
PS: if you know of any other GLSL IDEs, I'm open to that as well
Here they explain how to setup OpenGL on a MacOS on Xcode:
https://www.youtube.com/watch?v=Tz0dq2krCW8&list=PLRtjMdoYXLf6zUMDJVRZYV-6g6n62vet8

Trying to find out what specific atom package changed terminal functionality

I installed Atom over the weekend and installed some packages to make it more functional. After installing some of the packages, I ran terminal and ran a g++ command to compile some software and the error codes and display now look a lot different. Its actually much more clear in this form what the issues are, but that's besides the point. I'm wondering if anyone might know which package might've caused this sort of change? The easiest thing to do would be be to list all of the packages I downloaded, but I downloaded quite a few and ended up uninstalling some, so I don't even have a definitive list of what they could be. I'm not even 100 percent positive that it was an Atom package that changed the g++ output, but I don't recall it looking this way before. What I'm referring to is the error message and the green arrow pointing to the exact issue. I don't believe this was the way the output looked before after trying to compile a program with issues.
I realize this is a vague request to track down, but if anyone has any idea which package might've changed the way g++ outputs errors to the screen, that would be awesome.
I'm ultimately trying to figure out how to remove whatever it was that changed it and go back to the original output, so if anyone has any suggests for maybe reverting the functionality, I would try that as well.
Apparently, I've spent a majority of my time compiling in the linux shell via g++ that I never really paid attention to the the way the error messages look in mac terminal when using g++.
After a bit of digging, I found that g++ is using clang. After looking at the clang documentation for "Expressive Diagnostics," I've come to find that these sort of markups (what Clang devs are calling "Caret Diagnostics and Range Highlighting") are normal and standard, not installed by Atom. I must've drawn that conclusion randomly out of paranoia, after installing packages and packages for Atom and only then, noticing the difference in error output between Linux shell g++ and Mac Terminal g++.
A poster named "Adam" suggests that "Homebrew" is an easier way of getting Terminal to revert back to using GCC instead of Clang, which should be close to what I'm used to with the Linux shell experience with g++

How to set up debugger in lazarus - syscall-template.s missing

I am trying to debug my apps in lazarus on ubuntu 14.04, I searched and made all instructions described at lazarus wiki but when I try to use debugger I am getting dialog about missing syscall-template.s file and whether I want to locate it myself.
Is it some sort of bug or where could I find that file it is asking for?
I am getting dialog about missing syscall-template.s
Probably it is asking about syscall-template.S (which is slightly different from what you said, and small details often matter in programming).
That file is part of GLIBC. You can install GLIBC sources, and locate that file there, but it's not at all interesting, and a better choice for you would be to ignore this file and concentrate on what you are actually trying to debug.

Clang Mac OS X Maveric, not supporting fsanitize=undefined

I'm getting a segfault in my C program, and I thought I'd use Clangs help in figuring out why, as Valgrind isn't supported (yet).
I try to compile my program with -fsanitize=undefined to activiate runtime checks for undefined behaviour. All I'm getting is an error message which reads something like: "fsanitize doesn't support option 'undefined'". I've also tried using -fsanitize=address with the same result :/
Anyone know why this is?
It seems like -fsanitize is not supported by apple's CLang.
If you go here http://llvm.org/releases/download.html#3.4 you can get the prebuild binaries of clang, that do recognize this option.
However this is harder because then you have to use a Makefile,
IF by chance you use cmake, then you can just easily go to use makefiles.
OR replace the binaries in the Xcode.app/Contents/Developer/Toolchains/.../bin
but I don't know what can happen if you replace Apples binaries, do a backup before to be able to restore.
Honestly, I'm not myself confortable about replacing apple's binaries, because they probably added something in the clang to make it work with Xcode nicely.
Again, the GPL policy of GCC had this advantage that apple could not modify it.
-> another solution is to develop on linux,
The port to windows of CLang is on its way, but not ready yet, maybe in 3.5.
Best

how to obtain VC++ compiler-style help on GCC G++ compile/link errors (on linux)

I'm using VC++ as professional developer for more than 10 years and it has been good to me, now I'm trying to broaden my horizons and learn C++ development on Linux.
On Windows things are simple, VC++ does it all (editing, project management, help, debugging), but on linux things are different, you have assemble your development environment from different tools.
I'm still trying to tie things together, and one thing I still haven't figured out is how to decipher GCC (G++) errors when compiling/linking C++ apps on Linux (although I realize GCC is multi-platform, I'll refer to my linux experience here only).
In VC++, things are very clear: If during compilation VC++'s compiler encounters error in program, it will create new entry in 'output' window with the 'compiler error ID'. Example:
c:\projectA\fileB.cpp(38) : error C2228: left of '.cout' must have class/struct/union
From here, you can click on the line in question in 'output' window, press F1, and 'Microsoft Document Browser' app will start (if it wasn't started already), which will load MSDN help file describing compile error connected to the compiler error ID (in example it's C2228), usually with sample you can check out to figure out what's wrong with your code. If you don't have MDB installed, you can always search on the web for C2228 and get the same help page, optionally finding other people's web pages describing their experience with this error.
The same thing is with linking, you'll get 'linker error ID' (e.g. LNK1123), which you can use to find help either locally or on web.
Try as I might, I can't find this kind of functionality in GCC's G++. All I can see is bunch of less experienced GCC developers asking another bunch of more experienced GCC developers to analyze their code based on descriptive compiler/linker errors with no associated error IDs.
Is there tool(set) that provides VC++ compiler-style help on GCC G++ compile/link errors for linux?
You may try to use qtcreator. At least it can show the errors in a more comprehensive way comparable to the VC++, that is, it can locate the error position and highlight the error line and variables.
If you can an alternative might be to use Clang instead. It gives much better error messages than g++. It compiles most code these days (but it still a work in progress). Highly recommended.
Alternatively (as another poster has mentioned) you could use an IDE such as Eclipse to capture the error messages, though I don't think that adds anything beyond taking you to the line number on double-click.

Resources