In every editor I open an OF example project, for instance, the openFrameworks files that are included can’t be resolved and I get many errors. For example, ofMain.h comes up with a file not found error. Stuff like ofBaseApp or ofRunApp gives an error as well. What did I forget to do?
Hmm - are you trying to download via Git or are you using the packaged release?
We would recommend downloading the packaged release from:
download | openFrameworks ( nightly builds are at the bottom, but I would try 0.11.2 first ).
Then check out the setup guide:
https://openframeworks.cc/setup/linux-install/
If you are still having issue can you let us know what Linux distro you are on and maybe copy and paste the errors?
Hope that helps!
Theo
Hi Theo thank you for the response, I’m using the packaged release. 0.11.2 didn’t want to compile but the nightly build works just fine. I’m running Manjaro, and I can run examples alright, however after opening the files things start to become underlined with errors, files not found and unknown types, etc. For example, I’ll include a screenshot of the errors that come up if I open main.cpp in the 3D primitives project:
I found the solution, it had nothing to do with open frameworks actually. Since I’m using emacs I tried switching to LSP mode to see if that helped but I got the same errors. From the Emacs LSP mode website under project setup:
“To understand your source code,
clangd
needs to know the compiler flags that are used to build the project. (This is just a fact of life in C++, source files are not self-contained). By default,clangd
will assume your code is built asclang some_file.cc
, and you’ll probably get spurious errors about missing#include
files, etc.”
I solved this by using bear – make to generate the compile_commands.json file mentioned in the LSP configuration guide and then importing the project with CCLS. Hopefully this helps any fellow newbies trying to setup OF!