Installation experience on ubuntu 22.04 and vscode

I am new to ubuntu 22.04 system. I started using a little over a month ago and still don’t know much. But I want to describe the steps that I had to take to install and start using openframeworks. When installing according to the instructions, I encountered errors that spoke about the lack of some libraries. I’ll just list the commands I typed:

sudo apt-get install libgstreamer*

sudo apt-get install libcurl4-openssl-dev

sudo apt-get install pkg-config

sudo apt-get install libglfw3 libglfw3-dev

An error occurred: "uriparser/Uri.h: No such file or directory"
I decided with the help of advice from this forum (I don’t remember where it met …):

Jump to:

…/OF/libs/uriparser/include/uriparser

Copy the entire folder containing the header files (Uri.h).

And paste it in:

…/OF/libs/openFrameworks/utils

and then another series of commands followed … :

sudo apt-get install libxcursor-dev

sudo apt-get install libxi-dev

sudo apt-get install libxinerama-dev

sudo apt install libxi-dev

sudo apt autoremove libxi-dev

sudo apt install libxi-dev

sudo apt install libgtk-3-dev

and again:

sudo sh ./install_dependencies.sh

Then openframeworks and the generator were compiled.

to work, I generated a project:

screenshot

The project can be opened in vscode, but there were squiggly lines in the c_cpp_properties.json file:

I had to change “5” to “11” in the file paths:

“/usr/include/c++/11”,
“/usr/include/c++/11/backward”,
“/usr/lib/gcc/x86_64-linux-gnu/11/include”,
and similar…

also file underscores also remain “cairo”, “curl”, “glew” and…
but this does not prevent the project from compiling(just commented them out)…

and:

“intelliSenseMode”: “linux-clang-x64”,
“compilerPath”: “/usr/bin/clang++”,

There is also a permissions issue - then in vscode I do

sudo make

So far everything seems to be…

1 Like

Hey @scherbakov.al wow you did a lot to get this working! Maybe @WillpowerStudios can post some comments if I missed anything below or got something wrong. Also thanks for starting a new thread and for sharing your experience! The previous thread had accumulated quite a few ideas.

Here are a few thoughts:

  1. Ubuntu 22.04 has been difficult, and others have had problems. The 20.04 release was much easier.
  2. The nightly build has added some packages that are installed with the install_dependencies.sh script, so you can give it a try if you like.
  3. The last time I tried an installation about 6 weeks ago, I also installed build-essential to get make, and also had to install libgtk-3-dev separately from the install_dependencies.sh script.
  4. The nightly build uses c++17 by default. You may have to set a flag in the .qbs file to make the project compatible with c++17 too. And keep this in mind if you use a different IDE.
  5. A gStreamer issue (in the 20.x releases) has also been fixed in the nightly build, so definitely use the nightly if you want to use the video classes in OF.
  6. I also think an rtAudio issue was fixed in the nightly build but I could be wrong about that.
  7. Qt Creator 6.0.2 seemed to work OK with Ubuntu 22.04. 7.0.2 did not and I can’t remember if anything from 5.x.x worked or not but I’m thinking not.
  8. The latest LDME seems to work great with everything, and I’d bet the latest Debian does too. So there are other distros available if you don’t mind switching to one that is not based on Ubuntu. But again you’ll want the nightly if you need to use video classes.

OK I hope this helps. Usually it is very easy to install OF on Ubuntu and related distros, but this latest Ubuntu release seems very different from the previous ones.

2 Likes

Thanks for your thoughts!
While I will not try other Linuxes and I will lose qt somewhere at my leisure) All these reinstallations take too much time. While vscode suits. Most likely I will not experiment with the video, but the sound is output (so far without problems).
I still don’t quite understand where you can specify the C ++ version … and change the optimization flags. somewhere in the depths of the make files?

Hey! Each project should have its own config.make in the project folder. You can add flags there if needed. Somewhere toward the bottom (like line 141 ?) you could do this for c++17 if you were using the nightly:

PROJECT_CXX += -std=c++17

But, if you’re not using the nightly then you shouldn’t need to do anything with config.make to compile a project.

And each project has an addons.make file, where the addons used in the project are listed. I think the Project Generator adds them as needed. So if I wanted to use ofxGui and ofxOpenCv, the addons.make would look like this:

ofxGui
ofxOpenCv

There are other makefiles in OF that I haven’t explored or changed. Basically if you’ve got OF compiled, can run a project from the /examples folder, and you can create a new project that also compiles then things should be ready to go! I always love to run the /examples/graphics/polygonExample when I do a new OF installation, just to make sure things are working correctly.

1 Like

Nightly build does not generate workspace for vscode. But if you insert the .vscode folder and the *****.code-workspace file(from project generated from release), then everything is fine.

Also I don’t understand. The obj folder has root access. Is that how it should be? Or did I do something wrong?
Because of this error:

/bin/sh: 1: cannot create …/of_v20221011_linux64gcc6_nightly/of_v20221011_linux64gcc6_release/addons/obj/linux64/Release/.compiler_flags: Permission denied

screenshot 2022-10-11 17-29-50

access “root”

1 Like

I’ve always run the compileOF.sh script as sudo, but I’m not sure if you have to or not. I see in the guide that its not sudo. If the compileOF.sh is sudo, then sudo isn’t needed when compiling a project with make in a terminal.

Yeah I think the only time to use sudo is for the install_dependencies.sh and install_codecs.sh the compile OF or compile projectGenerator step shouldn’t be sudo.

I also don’t recommend installing it, but just running it out of OF_ROOT/projectGenerator once it is built .

1 Like