Qt project creation


#1

Hey there,

I’m trying to set up a sample project in Qt creator 4.1 using Ubuntu 16.04 and the latest release from the of master branch. I installed the of add on and tried to import an example project. Then this error occured:

[pathToOf]/libs/openFrameworksCompiled/project/qtcreator/modules/of/of.qbs:555: error: Result of expression ‘CORE.cflags’ [undefined] is not an object.

Does anyone know what this error means, since I never used Qt before.

Thanks in advance


#2

Ok, i used the workflow described by @frauzufall here and everything worked fine.

  1. Copy (empty) example or old project
  2. Copy Makefile and config.make from scripts/templates/linux64 to project folder
  3. (optional) change OF path in config.make
  4. (optional) add addons.make file with used addons, one per line, if any addons are used
  5. (optional) add addons.make file with used addons, one per line
  6. Go to Qt Creator > New Project > Import Project > Import Existing Project > Chose the project folder > confirm the rest
  7. Set executable under Projects > Run > Executable (usually I have to put projectName_debug in there) and set Working directory to %{buildDir}/bin

#3

Hello,
Investigating this issue, it seems to be related to the Qt version.
@brino / @frauzufall 's solution is great but relies on the make build system, simply wrapped into Qt Creator.
I prefer the .qbs build system which comes with more options, and I managed to get it to compile.

So on Ubuntu / Mint 16.0, I use Qt Creator 4.0.1 with Qt 5.6.1, a freshly generated OF project for Qt linux 64. (not using addons.make but defining of.addons in the .qbs file)
Following the Qt setup guide, it did not compile because it was trying to use the C compiler. To get it to compile, I just had to add a “kit” and set it to use C++ instead of C.
–> (Go to projects, manage Kits and in the compiler drop menu select GCC (C++ x86 64bit in /usr/bin) instead of GCC (C x86 64bit in /usr/bin))
And voila, build & run. :slight_smile:


E: Unable to locate package libgl1-mesa-dev-hwe-16.04 AND This package doesn't support your platform, probably you downloaded the wrong package? [UBUNTU]