ofxOpenCv.h compiler error

I try to set up a project in CodeBlock with opencv libraries. To set-up the project I used the Project Generator and i added the “ofxOpenCv” and the ofxVectorGraphics"

If I try to compile the empty file but the debugger holds at #include “ofxOpenCv.h”.
I tried to add the path to the Compiler and Debugger Settings without success.

I can’t find t he file “ofxCv.h” at all on my computer. I use Ubuntu 12.04.2 LTS.

Thanks Martin

After installing the ofxCV lib form https://github.com/kylemcdonald/ofxCv/wiki/Intermediate-Computer-Vision-with-openFrameworks
still I get errors:
Unable to open …/…/…/libs/openFrameworksCompiled/project/win_cb/openFrameworksLib.cbp

Investigating I can’t find the win_cb folder at all but instead I get:


Do I miss something
Thanks Martin

i think you are trying to open a windows project in linux, that won’t work. try to find out which addons the project uses and then generate it using the project generator

I’m trying to compile an example file (exapmple-ar) of the ofcCv lib. I installed the lib with git clone …
Does git clone works also for Windows?

This is what I did:
cd addons/
git clone https://github.com/kylemcdonald/ofxCv.git

The addons.make file of the above project has two entries:

If I create a project with the ProjectGenerater and add ofxCv and ofxOpenCv
can I just copy the other files from the project into the new folder?

Thanks Martin

you can point the project generator to the folder of the example and it’ll add the existing files

After getting this error:

||=== M_FORUM, Debug ===|
src/testApp.h|4|error: #include expects “FILENAME” or |
||=== Build finished: 1 errors, 0 warnings ===|

I found out that in writing #include <ofxOpenCv.h> the object compiles (uff, this took long).
Has this to do with relative and absolute path?

Yesterday I installed the “of_v0.8.0_linux64_release” version but I can’t find a “bash” to run the ProjectGenerator.

I have in mind to test this code here:

I’m on th way thanks Martin

#include “ofxOpenCv.h” should work and indeed is more correct than <> for this case, <> is usually used for header files installed in the system rather than locally.

what do you mean you can find a bash? the install_dependencies script should compile the PG for you. You just need to double click it to open it.

I had to run “make” in the openFrameworks8/apps/projectGenerator/projectGeneratorSimple folder, now it works.

The <> issue is somehow confusing. As soon as I edit the testApp.h file (paste a copied code) I have to change the “” to <> in the testApp.h, but in the main.cpp file the “” is the one I have to use.

Perhaps this is why I have problems with declared variables.
For example the following code wan’t accept the i variable even so the “int i” is declared on top of the page as global variable.

// extract of testApp.cpp
#include “testApp.h” // header of testApp.cpp the include is written “”.

int circleX, circleY, i, red, green, blue; // declaring variables.

void testApp::keyPressed(int key){

if(key == 115)
i– ;
if(key == 119)
i++ ;


The error I get is:
src/testApp.cpp:97:1: error: stray ‘\342’ in program

Thanks Martin

this has nothing to do with the include look in line 97 of testApp.cpp there is a strange character in that line that is not valid in c++