Getting started in Eclipse

Hello there,

I’m trying to get OF working in eclipse, but I’m completely struggling! I’ve been trying to follow some tutorials or hints on google, but nothing very useful.

Here I am. I’ve downloaded the latest from github in an “openFrameworks” repository, in my everyday workspace for my eclise (in which I have CDT, FDT, Aptana, and a few other plugins). Following the basic instructions, I’ve created a project, in a folder in apps (full path: openFrameworks/apps/OFDev/, with OFDev the name of my project).
I made sure I can compile the simplest Hello World ever, without any library.

I then copied the content of the graphicsExample (openFrameworks/examples/graphics/graphicsExample), in my src folder, and I’m now trying to compile. See attached for what I get as errors. I think it’s quite normal, as I did not link the library (I’ve read I have to link “libs” and “addon”).

A) First, have I set this up right? Project location … etc?

B) What is the right way to link libraries? i’ve seen many places in the project projets, tried to link stuff everywhere. The more I can get is a proper link to ofMain.h, but more errors coming from this same file.

Any help would be much appreciated.

Thanks a lot !!

one think that you can check immediately is that your project is in the wrong folder depth. compare your project location to the location of the graphics example. there are way around this, but it’s best to start with the default way - put your project files in OF/apps/myApps/myProject/
then, have you added the OF projects to your workspace already?
File > Import and select General > Existing projects in the workspace…
Import in this order:
openFrameworks/libs
openFrameworks/libs/openFrameworks
openFrameworks/addons

All right, my mistake for the project path, it’s good now, i’ve added the name of my company in between to add one depth level.

I’ve also imported those 3 projects in my workspace, and I now have completion on the classes name and functions.
But, when I build, the compiler takes ages and ends up every time in a infinite loop trying to do something.
I also get a warning like “OpenGL/gl.h is missing”.

What do you think? I’m nearly there!

Here is a screenshot of what I get when trying to compile, every time I does that I always get stuck at some point, and I have to reboot the hard way.

Any idea anyone? Cheers!

OK, it says pkg-config - command not found. that’s bad. have you already run / scripts / linux / ubuntu / install_dependencies.sh ?

I have not !!

Here is what I got, it looks like what I had in the eclipse console:

  
  
make: pkg-config: Command not found  
compiling object for  ../../../openFrameworks/3d/of3dUtils.cpp  
mkdir -p obj/Debug/openFrameworks/3d  
g++ -g3 -Wall -fexceptions -I../../../FreeImage/include -I../../../assimp/include -I../../../assimp/include/Compiler -I../../../cairo/include -I../../../cairo/include/cairo -I../../../cairo/include/libpng15 -I../../../cairo/include/pixman-1 -I../../../fmodex/include -I../../../freetype/include -I../../../freetype/include/freetype2 -I../../../freetype/include/freetype2/freetype -I../../../freetype/include/freetype2/freetype/config -I../../../freetype/include/freetype2/freetype/internal -I../../../freetype/include/freetype2/freetype/internal/services -I../../../glew/include -I../../../glew/include/GL -I../../../kiss/include -I../../../portaudio/include -I../../../rtAudio/include -I../../../tess2/include -I../../../videoInput/include -I../../../poco/include -I../../../glu/include -I../../../openFrameworks/ -I../../../openFrameworks//3d -I../../../openFrameworks//app -I../../../openFrameworks//communication -I../../../openFrameworks//events -I../../../openFrameworks//gl -I../../../openFrameworks//graphics -I../../../openFrameworks//math -I../../../openFrameworks//sound -I../../../openFrameworks//types -I../../../openFrameworks//utils -I../../../openFrameworks//video   -MMD -MP -MFobj/Debug/openFrameworks/3d/of3dUtils.d -MTobj/Debug/openFrameworks/3d/of3dUtils.o -o obj/Debug/openFrameworks/3d/of3dUtils.o -c ../../../openFrameworks/3d/of3dUtils.cpp  
In file included from ../../../openFrameworks//utils/ofConstants.h:111,  
                 from ../../../openFrameworks//math/ofVec2f.h:5,  
                 from ../../../openFrameworks//math/ofVectorMath.h:3,  
                 from ../../../openFrameworks/3d/of3dUtils.h:2,  
                 from ../../../openFrameworks/3d/of3dUtils.cpp:1:  
../../../glew/include/GL/glew.h:1170:24: warning: OpenGL/glu.h: No such file or directory  
In file included from ../../../openFrameworks//math/ofVec2f.h:5,  
                 from ../../../openFrameworks//math/ofVectorMath.h:3,  
                 from ../../../openFrameworks/3d/of3dUtils.h:2,  
                 from ../../../openFrameworks/3d/of3dUtils.cpp:1:  
../../../openFrameworks//utils/ofConstants.h:112:24: warning: OpenGL/gl.h: No such file or directory  
make: pkg-config: Command not found  
compiling object for  ../../../openFrameworks/3d/ofCamera.cpp  
mkdir -p obj/Debug/openFrameworks/3d  
g++ -g3 -Wall -fexceptions -I../../../FreeImage/include -I../../../assimp/include -I../../../assimp/include/Compiler -I../../../cairo/include -I../../../cairo/include/cairo -I../../../cairo/include/libpng15 -I../../../cairo/include/pixman-1 -I../../../fmodex/include -I../../../freetype/include -I../../../freetype/include/freetype2 -I../../../freetype/include/freetype2/freetype -I../../../freetype/include/freetype2/freetype/config -I../../../freetype/include/freetype2/freetype/internal -I../../../freetype/include/freetype2/freetype/internal/services -I../../../glew/include -I../../../glew/include/GL -I../../../kiss/include -I../../../portaudio/include -I../../../rtAudio/include -I../../../tess2/include -I../../../videoInput/include -I../../../poco/include -I../../../glu/include -I../../../openFrameworks/ -I../../../openFrameworks//3d -I../../../openFrameworks//app -I../../../openFrameworks//communication -I../../../openFrameworks//events -I../../../openFrameworks//gl -I../../../openFrameworks//graphics -I../../../openFrameworks//math -I../../../openFrameworks//sound -I../../../openFrameworks//types -I../../../openFrameworks//utils -I../../../openFrameworks//video   -MMD -MP -MFobj/Debug/openFrameworks/3d/ofCamera.d -MTobj/Debug/openFrameworks/3d/ofCamera.o -o obj/Debug/openFrameworks/3d/ofCamera.o -c ../../../openFrameworks/3d/ofCamera.cpp  
In file included from ../../../openFrameworks//utils/ofConstants.h:111,  
                 from ../../../openFrameworks//math/ofVec2f.h:5,  
                 from ../../../openFrameworks//math/ofVec3f.h:3,  
                 from ../../../openFrameworks//types/ofPoint.h:3,  
                 from ../../../openFrameworks//types/ofRectangle.h:13,  
                 from ../../../openFrameworks/3d/ofCamera.h:20,  
                 from ../../../openFrameworks/3d/ofCamera.cpp:10:  
../../../glew/include/GL/glew.h:1170:24: warning: OpenGL/glu.h: No such file or directory  
In file included from ../../../openFrameworks//math/ofVec2f.h:5,  
                 from ../../../openFrameworks//math/ofVec3f.h:3,  
                 from ../../../openFrameworks//types/ofPoint.h:3,  
                 from ../../../openFrameworks//types/ofRectangle.h:13,  
                 from ../../../openFrameworks/3d/ofCamera.h:20,  
                 from ../../../openFrameworks/3d/ofCamera.cpp:10:  
../../../openFrameworks//utils/ofConstants.h:112:24: warning: OpenGL/gl.h: No such file or directory  
../../../openFrameworks/3d/ofCamera.cpp: In member function ‘virtual void ofCamera::begin(ofRectangle)’:  
../../../openFrameworks/3d/ofCamera.cpp:112: error: ‘gluPerspective’ was not declared in this scope  
make: *** [obj/Debug/openFrameworks/3d/ofCamera.o] Error 1  
there has been a problem compiling Debug OF library  
please report this problem in the forums  
  

that can’t be all the output - there should be some apt-get stuff before that. use it with sudo, btw.

btw, I have reported the issue with the double slashes as https://github.com/openframeworks/openFrameworks/issues/1393 since you’re not the only one reporting it.

More stuff here, I swear to god I’ll make a tutorial when all this is over.
Do you think I need xCode so I can access many command line tools? I couldn’t manage to install it (but managed to install “make” though). I also had to install the pkg-config command line tool.

Here is what I got as I was running the script you told me about using sudo:

  
  
./install_dependencies.sh: line 1: apt-get: command not found  
./install_dependencies.sh: line 2: apt-get: command not found  
id: illegal option -- -  
usage: id [user]  
       id -A  
       id -G [-n] [user]  
       id -M  
       id -P [user]  
       id -g [-nr] [user]  
       id -p [user]  
       id -u [-nr] [user]  
Package gstreamer-0.10 was not found in the pkg-config search path.  
Perhaps you should add the directory containing `gstreamer-0.10.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'gstreamer-0.10' found  
Package gstreamer-video-0.10 was not found in the pkg-config search path.  
Perhaps you should add the directory containing `gstreamer-video-0.10.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'gstreamer-video-0.10' found  
Package gstreamer-base-0.10 was not found in the pkg-config search path.  
Perhaps you should add the directory containing `gstreamer-base-0.10.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'gstreamer-base-0.10' found  
Package libudev was not found in the pkg-config search path.  
Perhaps you should add the directory containing `libudev.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'libudev' found  
compiling object for  ../../../openFrameworks/3d/ofCamera.cpp  
mkdir -p obj/Debug/openFrameworks/3d  
g++ -g3 -Wall -fexceptions -I../../../FreeImage/include -I../../../assimp/include -I../../../assimp/include/Compiler -I../../../cairo/include -I../../../cairo/include/cairo -I../../../cairo/include/libpng15 -I../../../cairo/include/pixman-1 -I../../../fmodex/include -I../../../freetype/include -I../../../freetype/include/freetype2 -I../../../freetype/include/freetype2/freetype -I../../../freetype/include/freetype2/freetype/config -I../../../freetype/include/freetype2/freetype/internal -I../../../freetype/include/freetype2/freetype/internal/services -I../../../glew/include -I../../../glew/include/GL -I../../../kiss/include -I../../../portaudio/include -I../../../rtAudio/include -I../../../tess2/include -I../../../videoInput/include -I../../../poco/include -I../../../glu/include -I../../../openFrameworks/ -I../../../openFrameworks//3d -I../../../openFrameworks//app -I../../../openFrameworks//communication -I../../../openFrameworks//events -I../../../openFrameworks//gl -I../../../openFrameworks//graphics -I../../../openFrameworks//math -I../../../openFrameworks//sound -I../../../openFrameworks//types -I../../../openFrameworks//utils -I../../../openFrameworks//video   -MMD -MP -MFobj/Debug/openFrameworks/3d/ofCamera.d -MTobj/Debug/openFrameworks/3d/ofCamera.o -o obj/Debug/openFrameworks/3d/ofCamera.o -c ../../../openFrameworks/3d/ofCamera.cpp  
In file included from ../../../openFrameworks//utils/ofConstants.h:111,  
                 from ../../../openFrameworks//math/ofVec2f.h:5,  
                 from ../../../openFrameworks//math/ofVec3f.h:3,  
                 from ../../../openFrameworks//types/ofPoint.h:3,  
                 from ../../../openFrameworks//types/ofRectangle.h:13,  
                 from ../../../openFrameworks/3d/ofCamera.h:20,  
                 from ../../../openFrameworks/3d/ofCamera.cpp:10:  
../../../glew/include/GL/glew.h:1170:24: warning: OpenGL/glu.h: No such file or directory  
In file included from ../../../openFrameworks//math/ofVec2f.h:5,  
                 from ../../../openFrameworks//math/ofVec3f.h:3,  
                 from ../../../openFrameworks//types/ofPoint.h:3,  
                 from ../../../openFrameworks//types/ofRectangle.h:13,  
                 from ../../../openFrameworks/3d/ofCamera.h:20,  
                 from ../../../openFrameworks/3d/ofCamera.cpp:10:  
../../../openFrameworks//utils/ofConstants.h:112:24: warning: OpenGL/gl.h: No such file or directory  
../../../openFrameworks/3d/ofCamera.cpp: In member function ‘virtual void ofCamera::begin(ofRectangle)’:  
../../../openFrameworks/3d/ofCamera.cpp:112: error: ‘gluPerspective’ was not declared in this scope  
make: *** [obj/Debug/openFrameworks/3d/ofCamera.o] Error 1  
there has been a problem compiling Debug OF library  
please report this problem in the forums  
  

Wait, XCode? Are you on MacOS? That changes everything, forget what I said. I’ll let someone else speak, can’t help with MacOS…

edit: my mistake, just realized your screenshot shows the MacOS titlebar.
didn’t you get suspicious when I told you to run scripts/linux/ubuntu/install_dependencies.sh?

Actually I was, but though “oh, this guy is an administrator, he must have seen the window chrome on my screenshots, he must know”, and the script kind of ran fine besides the “apt-get” missing. But thanks for you help!!

Do you think I can be missing a few things here? like some commands found in xcode ?

yes you’re definitely missing some packages. Check this guide: http://www.openframeworks.cc/setup/android-eclipse/
It’s for Android, but it at least touches OSX&Eclipse setup. See e.g. “For OSX:” in point e), this could be what you need.

All right, I’ve taken thing seriously, re installed osx lion, xcode and stuff, everything!

It still does not work on eclipse, neither does it in xcode. I only get 2 errors in xcode as I try to run the “AdvancedImageLoading” example:

  
  
../../../libs/openFrameworks/utils/ofConstants.h:111:22: error: GL/glew.h: No such file or directory  
  

Anyone?

OK, according to arturo in the bug i reported, eclipse & make files on OSX aren’t supported: https://github.com/openframeworks/openFrameworks/issues/1393#issuecomment-6904160
Still, it should work on XCode, so try to get it to run on XCode successfully, then depending on your makefile chops maybe you can fix the makefiles for OSX. :slight_smile:

What do you mean by “make files are not supported”, the way they are coded? Because the make command is definitely available on osx

yes, but the make file structure as it currently exists in OF is not suited for use with OSX.