Hello everybody, I am checking if some addons that I have written in the past still work and I bumped in this error on linux, I am using the last ubuntu with the last nightly linux version of OF.
The application /examples/gui/guiExample fails to compile with this error.
Hey @edapx , try adding the -std=c++17 flag to the project. I use Qt Creator so I added it in the .qbs file. I got the same error when I didn’t use the flag.
Yeah that’s the line and the change looks great! I apologize as I should have posted a fix for it so I’m glad that you did. After playing around a bit yesterday, the flag doesn’t seem necessary when compiling with make. There might be a way to tell Qt Creator to always use c++17.
So, as far as I have understand, the script install_template.sh needed to use qt on linux reads the template file that I have linked before. So modifying that file should modify the qbs file whenever you create or import an OF project with QT.
Modifying the template sounds like a great idea, and seems like it should work. The install_template.sh script looks like it just copies the files to a location where Qt can find them. I wonder if this would be a good pull request too.
Support for c++17 is default in the nightly, but the gcc version (in config.linux.common.mk) also determines how OF is compiled. Maybe the install_template.sh could find the gcc version in a similar way. I think these two lines (141, 142) from config.linux.common.mk get the gcc version: