How to open tutorials in codeblocks in ubuntu - cant find ofMain.h

I installed openframeworks with codeblocks from github, when I import one of the tutorials projects it can’t find ofMain.h.

Is there a particular way I should be opening these tutorials, or do I need to tell codeblocks where to find OF?

g++  -I/mnt/data/home/stu/projects/external/openFrameworks -c /mnt/data/home/stu/projects/external/openFrameworks/examples/video/videoPlayerExample/src/main.cpp -o /mnt/data/home/stu/projects/external/openFrameworks/examples/video/videoPlayerExample/src/main.o
/mnt/data/home/stu/projects/external/openFrameworks/examples/video/videoPlayerExample/src/main.cpp:1:20: fatal error: ofMain.h: No such file or directory
 #include "ofMain.h"
                    ^
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

Hi @stuaxo Did you create the cb project with the ProjectGenerator or how?

Hi,
For that one I just imported the files. Since then I’ve got the project generator working. I’m really just want to know how to load one of the examples into codeblocks, there are “.project” files, but I don’t know how to open that with codeblocks.

Also… the script to compileAllExamples - doesn’t seem to leave any binaries anywhere (?).

To try the examples, do I need to generate a new project first ?

.project file is used by eclipse ide, instead .cbp and .workspace file are used by codeblocks ide. follow this guide if you are using linux, and to use ProjectGenerator this [tutorial][2].

[2]: http://openframeworks.cc/tutorials/introduction/002_projectGenerator.html[quote=“stuaxo, post:3, topic:15927”]
Also… the script to compileAllExamples - doesn’t seem to leave any binaries anywhere (?).
[/quote]

i think that script was valid for the previous versions 006, you need to use the projectGenerator to generate the project.

The instructions say “… open the openFrameworks examples in the apps folder just by double clicking on the .cbp file”

But I can’t work out which cbp to open, I thought there might be one in each example directory ?

Here are all the .cpb files I can find:

$ find . | grep .cbp
./libs/openFrameworksCompiled/project/linux/libopenFrameworks.cbp
./libs/openFrameworksCompiled/project/linux64/libopenFrameworks.cbp
./libs/openFrameworksCompiled/project/win_cb/openFrameworksLib.cbp
./scripts/linux/template/linuxarmv7l/emptyExample_linuxarmv7l.cbp
./scripts/linux/template/linux/emptyExample_linux.cbp
./scripts/linux/template/linux64/emptyExample_linux64.cbp
./scripts/linux/template/linuxarmv6l/emptyExample_linuxarmv6l.cbp
./scripts/win_cb/template/emptyExample.cbp
./apps/devApps/projectGenerator/projectGenerator_linux64.cbp
./apps/devApps/projectGenerator/src/pugixmlLib/scripts/pugixml_codeblocks.cbp
./apps/devApps/projectGenerator/projectGeneratorLinux.cbp
./apps/devApps/projectGenerator/projectGenerator.cbp
./apps/devApps/fboTester/emptyExample_linux64.cbp
./apps/devApps/fboTester/emptyExample_win_cb.cbp
./apps/devApps/fboTester/emptyExample_linux.cbp
./apps/projectGenerator/projectGeneratorSimple/projectGenerator_linux64.cbp
./apps/projectGenerator/projectGeneratorSimple/src/pugixmlLib/scripts/pugixml_codeblocks.cbp
./apps/projectGenerator/projectGeneratorSimple/projectGeneratorLinux.cbp
./apps/projectGenerator/projectGeneratorSimple/projectGenerator.cbp
./apps/projectGenerator/projectGeneratorSimple/projectGeneratorSimple.cbp

No, you have to create them with the ProjectGenerator, the guide assumed that you have yet build the projects within PG (Project Generator). I think this part of the guide is a bit outdated (maybe referring to previuos versions). The project files are not included anymore, in github because the download became huge. You can also download the .zip file with all the example project files did you see this page? There are .zip files for every OS (windows, linux, mac, arm)…

Ah OK … so basically … foreach (example I want to try) … use project generator, then I guess I need to copy the source into the newly generated file ?

I saw that page, but since it was a tar.gz I preferred to just build from source.

Got a bit confused as it’s a bit diffferent to the last time I tried OF a couple of years ago.

Having said this, will just use the download since it appears projects are all setup, can understand not putting them in git, it was quite large to clone.

Cheers for the info :smile:

no,for example you want to create the codeblocks project file for the color example (located in the graphics examples) just open the PG, point the path to

 /home/your_name/openFrameworks/examples/graphics

and set the name of the project

color

and click generate project, you will find the .cbp .workspace and config.make makefile, the files in the src folder will not touched. It is different if you generate an entire new project, in this case also files in src folder are created, but i think you will find all this info in the tut.
and @stuaxo welcome back to OF you will discover a lot of more feature in it!

But if you want to try the tutorials example those are only on github… you will not find them on the zipped version!

Thanks, that example is really good - it might be worth including in one of the READMEs - I had no idea project generator was for the existing examples as well as new ones.

Although I’ve a lot of experience in development, C++ is new, as is the codeblocks IDE and OF - so lots to learn.