"Use of undeclared indentifier" error messages
-
I recently installed, using the online installer, the latest version of Qt/QtCreator (5.12.0, 4.8.0-rc1) on a clean install of Ubuntu 18.04 Everything seems to be working fine when recompiling and running my programs., except for the tons of error messages I get. See screenshot below for the simplest console application. My only additions to the cpp file generated by QtCreator are including iostream, and adding the std::cout line (which generates the message "expected expression). The program runs fine: it opens a console and prints "hello world" as instructed.
In my other programs i get messages like "variable has incomplete type 'void' ", "expected identifier or '(' " and numerous others, but in all cases I've looked so far they do what I expect them to.
The program was compiled with: CONFIG += c++11 console. Turning off Clang Code Model (under "Issues") did not change anything.
Thanks for your help, Gert
-
I recently installed, using the online installer, the latest version of Qt/QtCreator (5.12.0, 4.8.0-rc1) on a clean install of Ubuntu 18.04 Everything seems to be working fine when recompiling and running my programs., except for the tons of error messages I get. See screenshot below for the simplest console application. My only additions to the cpp file generated by QtCreator are including iostream, and adding the std::cout line (which generates the message "expected expression). The program runs fine: it opens a console and prints "hello world" as instructed.
In my other programs i get messages like "variable has incomplete type 'void' ", "expected identifier or '(' " and numerous others, but in all cases I've looked so far they do what I expect them to.
The program was compiled with: CONFIG += c++11 console. Turning off Clang Code Model (under "Issues") did not change anything.
Thanks for your help, Gert
Hi and welcome to devnet forum
You are using a release candidate of Qt creator. In the mean time we have 4.8.1 offically out. I recommend changing to the offical version. That might remove the problem already. Release candidates are still not the final version and may show unwanted behaviour.
@Gert-van-der-Zwan said in "Use of undeclared indentifier" error messages:
The program was compiled with: CONFIG += c++11 console. Turning off Clang Code Model (under "Issues") did not change anything.
This did not switch off the Clang Code Model. It is a plugin and you need to unselect under "Help"->"About Plugins..." under "C++" "ClangCodeModel" and probably restart creator.
-
Thank you, that helped. When installing I just took the top option for QtCreator. I did look for updates using the maintenance tool, but it did not show any. It still does not, maybe 4.8.1 does not count as an update. Anyway for the moment I am happy again.
-
Thank you, that helped. When installing I just took the top option for QtCreator. I did look for updates using the maintenance tool, but it did not show any. It still does not, maybe 4.8.1 does not count as an update. Anyway for the moment I am happy again.
@Gert-van-der-Zwan Well, an RC is newer than current stable version. Simply remove the RC version of QtCreator in Maintenance Tool and then select "Qt/Tools/QtCreator" there,