Semantic Issues with ofxDatGui on QtCreator

Hi, QtCreator is showing me errors on my ofxDatGui code. Still, it works. I would like to get rid of all warnings and errors.

I don’t know how I could copy the text from the errors (I can’t select the text). Screenshots did not work either, so I shot a video, exported frames, cropped them in Gimp, and here they are:

How could I get rid of those errors? Is it an issue with my code? With ofxDatGui? With the compiler?

are you using the clang code model?

I thought so, but I’m not sure. I have both gcc and clang installed. Which one should I use and where should I apply that setting?

I wanted to have real time code checking and I thought clang was the way to go.

in qt creator you can specify to use clang to do the static analisys which is different of which compiler you use to compile the code later.

you can set it in options > c++ > code model if you are using the clang code model it could be that clang is more strict than gcc with something and the static analisys finds an error where the compiler just works fine. i don’t think there’s much to do in terms of config but perhaps fix ofxDatGui to not have those potential errors

Thank you for the details! I managed to remove some of the warnings by using ofToString() around “strings”, but others as you say seem to be from inside ofxDatGui.

There are three options in c++ > code model for QtCreator:

  • Pedantic warnings
  • Warnings for questionable constructs
  • Warnings for almost everything

Do you prefer one of them?

i usually leave it as pedantic warnings but what you are seeing is not even a warning but an error so i don’t think it’ll make any difference