"Code model can't parse an included file" + no autocomplete + can't compile examples

qtCreator (version 4.2.2) is throwing this error in above script. says the code model can’t parse the files, shows this error at the top of every editor screen:

xmmintrin.h:130:19: error: use of undeclared identifier '__builtin_ia32_addss'

The files in src/ have some highlighting, so I’m wondering why It’s having “code parsing” errors autocomplete isn’t working though, so it leads me to believe something else is wrong. Like it’s not reading the header’s because I haven’t linked them perhaps?

clang code model is enabled.

when I ran clangstaticanalyzer which returned
:-1: warning: Clang Static Analyzer: Running with unsupported version 4.0.1, supported version is 3.9. this might be a bug with qt creator though.

I’m on linux (fedora 26)

thanks ~

building a bunch of the examples also throw these warnings:

:-1: warning: Enabling linker flags compatibility mode. cpp.linkerFlags and cpp.platformLinkerFlags escaping is handled automatically beginning in Qbs 1.6. When upgrading to Qbs 1.6, you should only pass raw linker flags to these properties; do not escape them using -Wl or -Xlinker. This allows Qbs to automatically supply the correct linker flags regardless of whether the linker chosen is the compiler driver or system linker (see the documentation for cpp.linkerMode for more information). This message can be silenced by setting your Project's minimumQbsVersion to 1.6 (and the new behavior will take effect).

hoping this may point to a solution, or at least the deeper problem. I’m going to look into rolling back clang static analyzer or whatever that error is trying to tell me.

/home/me/bin/oF/libs/openFrameworksCompiled/project/qtcreator/ofApp.qbs:119: warning: Deprecation warning: Group is not located in the same directory as the associated product and references files using a relative path. The base directory for resolving such paths will change in Qbs 1.8 from the directory of the product to the directory of the group. You should probably use an absolute path as the group prefix here.

seems like when I’m trying to build any project/example I’m also getting errors with poco and openSSLinitialize

is there something I have yet to link ? include?

the errors seem to be pointing at a strange (wrong?) directory.
undefined references are looking in ~/

thanks for checking it out

I can recommend what @arturo recommended me here: download qtcreator from their website.

I didn’t know, but it comes with its own dependencies. I’m running 4.2.2 from https://download.qt.io/official_releases/qtcreator/ and it works. I don’t like the idea of downloading programs from outside the package manager, but in this case I’ll do an exception, as it makes things easier.

If you don’t want to do that, an issue I see in your screenshots is that you are using a clang version that is too new. Maybe try with 3.9.x instead of 4.0.1?

I’m also running 4.2.2, I supposed there could be a discrepancy in that, but unless 4.2.2 straight from qt is different from what’s on the fedora repos…

downgrading clang looks to be an involved and risky operation, based on what I read.

Poco won’t (re)compile because I’m using gcc 7 (it needs 5 or lower, according to install_dep and apothecary). I tried downloading the official releases / nightlies and not running ./install_dependancies and trying ./compileOF.sh, still same errors with poco / headers / openSSL. going through scripts/apothecary and attempting to recompile poco through that doesn’t work. I also tried editing the /script/linux/fedora/install_dependancies.shfile below line 29, which does the gcc check / recompile of poco, that still doesn’t work, and it’s also something that needs to be updated in the codebase under the /linux/fedora directory.

Qt Creator 4.2.2
Based on Qt 5.7.1 (GCC 7.1.1 20170622 (Red Hat 7.1.1-3), 64 bit)

I’m somewhat at a loss of what to do here, I’ll try compiling the latest qtCreator. Other than that, I’m hesitant to downgrade clang, that option gives me a strong feeling of ‘wild goose chase’ with the added risk of causing a further cascade of issues with my system.

edit:: I went ahead and downloaded 4.1.0 && 4.4.0 from the link you gave me and managed to get it installed.: builds now throw >36000 errors, nearly all undefined references.

36000! not bad :slight_smile:

I’m using 4.2.2 from the link I mentioned. The difference between that and the one from fedora is that it comes with it’s own clang, and I think it uses that. So if I don’t get it wrong, I still have clang 5.0 for system use, but qtcreator downloaded from qt comes with clang 3.9, so you don’t need to downgrade it. It uses its own.

Does using 4.2.2 from qt help over using 4.1.0 and 4.4.0?

if you are using 0.9.8 it won’t work anymore with newest gcc versions, try using the nighly builds, you’ll need the gcc6 version which has libraries compatible with gcc 6 or newer.

Using nightly gives me a nearly identical result, same # undefined reference warnings except with boost instead of poco.

I have
Package boost-devel-1.63.0-8.fc26.x86_64 is already installed, skipping

The nightlies are precompiled binaries, no? Loading a new or example project from them, my Console Output still shows “compiling openFrameworks.” when I issue the run command.

Also still getting the same warning about not being able to parse the code model.

Side note: Qt creator 4.1.0 & 4.4.0 won’t create the right qbs project templates (even when oF has been linked in project creation) so I can’t even attempt a build with them to test compile errors. So far the only version of qt creator which hasn’t given me >400 errors during compile is 4.2.0 that I downloaded from fedora.

thanks for the help so far, guys

Official release, Nightly, and Github versions all throw the same amount / types of errors. I’m unable to compile any of the examples with any release (as well as new projects I make linked with oF/nightly/github). Even though the install_dependencies/codecs scripts complete mostly fine (except for that weirdness with poco)

Is this a problem with the fedora installs? @hamoid has no problem using qtcreator 4.2.0, but It looks like he’s on Arch. I’m going to attempt a windows install to see if I get any further, less than ideal (my windows environment is not set up at all for any sort of software work) but I don’t know what else to try at this point.

update: using windows doesn’t come across as particularly viable, since openframeworks doesn’t seem to be compatible with it’s newest version (2017 v15.3.5), & the plugin isn’t searchable through tools & extensions. The alternative here is to re-create my linux environment with qt-ceator and mysys2 (which is on top of cygwin by the looks of it) which is suboptimal.

Any ideas?

I’ve been in that situation several times, I know it’s frustrating. The only things I can suggest are

  • try clang instead of gcc.
  • download the libs from http://ci.openframeworks.cc/libs/ instead of compiling them yourself.
  • give the qtcreator download a try (instead of the system package).

Note: the git OF version was made compatible with qtcreator 4.4 only yesterday.

yeah this is excruciatingly frustrating. I’ve been trying to get this framework to compile for three weeks, restarting the process from scratch more times than I can count.

I’ve managed to get everything up and running in visual studio 2017, examples compile, took a custom written visual studio plugin: Visual studio 2017

In fedora I was able to download QtC 4.2 get it installed, delete the previous config, download the libraries form your link, use the (correct) nightly build, but then I was left with a new problem: templates wouldn’t load. the ‘new project’ would just create a single file with no other components (liek seen int he project browsers in my previous screenshots). this was even after placing the template folders into the right (as per documentation and my own exploration) paths.

So I tried again in visual studio, and had some success, after tracking down the right VS plugin.

Since i was able to get things running in visual studio, I tried to do the same with qt creator in windows, with msys2 as the compiler. There’s some tricks involved with getting qt creator working. First, you need to have the right compilers selected, and then you need to have the templates for oF working. I don’t know why, but I can’t get the templates for new projects working, they show up but when creating a new project but don’t appear in the project browser after said project has been initialized. This is where I was able to leave off with QtC in fedora, whereas with windows a the plugin was made by updating the previous one (2015).

This combined with several other users reporting the similar problems (dead ends) suggests it may be tied to housekeeping. because with both VS2017 and QtC the issues which required workarounds both are tied to the templates not being set up.

here is a list of other threads which have the same or similar problem

The libraries compile fine, the template folder has been placed in creator’s share folder.

but when I make that new project it’s empty, still throwing the “can’t parse included file/not part of any projects”

as you can see, I can’t even select ‘build’ for my project, even though I have compiler settings configured.

And msys2 is in my path, with success on installing dependancies and updates (as per the instructions)

kits are set up to use gcc in the msys2 directory.

At this point I will just get the ball rolling with visual studio, I’m already way behind on this project because of this install process. :unamused:

edit, guess not with visual studio either, because the openframeworks plugin doesn’t initialize projects correctly. I can compile the examples but not new projects ¯\_(ツ)_/¯

Post Mortem: closure.

Since making this thread I’ve since figured it all out. big thanks to @arturo & @hamoid for the help. I’m going to detail the outcomes and link them here for anyone who might come across this post in the future, maybe this will help someone else.
I apologize for the subject of this thread being loose , but this was multiple problems overlapping with eachother, making pinpointing a cause difficult.
I’m going to try to address them in the order of my posts, to hopefully tie off any loose ends.

1: I did not make good use of project generator from the start, I had the impression the plugins for QtCreator / vs studio were sufficient to ‘start’ the projects. This looks to be due to some weirdness to how QtCreator versions handle .qbs files and folder structures.
With project generator, you can apparently use any editor you want (on linux). I’m doing all of my current work with emacs. Just import + make is all I needed once I had the dependencies and compiled libraries. this is not made super clear, rather implied. Maybe it’s just something people assume or I am really dense.
1a: It may be something worth considering generalizing the linux install process. I’m not an expert, but I’m down to help out if I can, getting qtcreator to work was a nightmare unto itself. I never got qtCreator to compile projects correctly, but I assume many of my difficulties preventing me from getting to the root of the issue were sourced in not using pg. On the bright side I learned A LOT about basic compiler use outside of an IDE, so uh, thanks.

2: poco was not playing nicely with my gcc (v7, thanks redhat?) . the solution to this was to use the nightlies which have the libraries pre-compiled. If you download the nightlties, do not run ./compileoF.sh !! Another thing that was preventing compiles is addressed in point 4.

3: I have an nvidia optimus laptop, and apparently a .cpp file in in the gl libs needs a slight modification to work.
This post shows the workaround to get ofGui to play nicely. which was another source of headache, because even though some examples would compile, they wouldn’t function correctly. It was difficult to troubleshoot because it was difficult to describe*. Fortunately I came across that last thread while troubleshooting something completely unrelated!

  • this was solved just today but was basically my last (major) barrier to entry to get oF working on linux, so… woo! Only a week before my deadline! :stuck_out_tongue:

4: the framework’s path getting changed caused issues with built examples, preventing make from working,. Parent folder being renamed/moved/copied… it was easy to fix but it snuck up on me a few times and if anyone reading this in the future is trying to figure out why their example won’t compile, they should make sure they didn’t change the path to the (previously) built code. You may be able to remedy this with make clean, or use the clean examples script (vs also has a clean option?). Before anyone points out I’m a fool (why would he rename his folders!?), I want to first admit that I am a fool, and also new to working with third party libs and organizing them.
4b: I also think you can use project generator to re-import the examples/apps. It’s also good for addon examples which try to be platform agnostic.

5: I think I have autocomplete working too - just needed to enable clang with emacs. seems all it needed was the correct makefiles. More clarification would be nice here, not not necessary. I’ll update here if any new info.

6: There was also an issue with Vector graphics Example, PolyLine Blobs examples preventing the buildAllExamples.sh script from working. deleting those examples allowed buildallExamples to finish.

Lesson learned: project generator is amazing and it was the key to solving most my problems.

Cheers! :grin: