Any success at getting oF to work with Eclipse?

Hi,
I’m a novice Eclipse Helios / MinGW user on Windows and would like to make use of oF. I just downloaded oF but can’t figure out how to get it to work.

Does anyone have a recipe for success?

I’ve been trying to use OF in Eclipse as well, although I don’t really know what I’m doing. I’m on Win7 x64 by the way. My advice might not be completely reliable or correct, but this is what I have so far.

  • I downloaded the Indigo Java Eclipse package and fiddled with setting up Processing a little.

  • Using Eclipse’s built in software management, I then installed CDT (C/C++ development toolkit) and a GitHub plugin.

  • I managed to clone the GitHub of OF (and managed to delete the whole thing once by accident).

  • Eclipse doesn’t come with a compiler for C++, so I downloaded the self-installing version of MinGW.
    http://www.mingw.org/
    If this installs correctly Eclipse should have something like “MinGW toolchain” for you to chose when starting projects and you should be able to compile and run the included HelloWorld project from Eclipse. Make sure you add the path to MinGW/bin on the path environment variable.

  • You need project files to tell the compiler how to bring everything together. OF has a Python script to generate some. I installed Python 2.7 (after installing a 3 something version and realizing I couldn’t use the library with it) and the LXML library needed for the OF script.
    Installing Python stuff:
    http://wiki.python.org/moin/CheeseShopTutorial
    http://pypi.python.org/pypi/setuptools
    LXML:
    http://pypi.python.org/pypi/lxml/2.3
    After adding the path to python.exe to the path environment variable, I ran the Python script for CodeBlocks:
    openFramworks\scripts\win_cb\createProjects.py

  • I’ve been compiling on the command line and haven’t setup Eclipse to do it yet.
    I used cbp2make to convert the .cbp project files to makefiles that can be used with MinGW.
    http://sourceforge.net/projects/cbp2make/

I managed to compile the openFrameworks library (openFrameworks/libs/openFramworks) with this method, then moved on to emptyExample (openFrameworks/apps/examples/emptyExample). I managed to figure out this one was missing some libraries including zlib (http://zlib.net/) which I successfully installed (into the MinGW directory) via the included instructions. Now its looking for “strmbase” which is apparently DirectX related. I thought that was a little odd. If anyone has any insight into this I’d be interested. My instructions so far aren’t very specific, but hopefully they will be at least somewhat helpful.

[edit]
After searching the forum and finding this:
http://forum.openframeworks.cc/t/stmbase/427/0
I extracted the strmbase lib from a devpack referenced in the OF devcpp setup instructions and put it in the MinGW lib directory so now its not complaining about libraries anymore. I guess I’m on track. The devpack link:
http://www.dgrigoriadis.net/post/2004/06/26/DirectXDevPak-for-Dev-Cpp.aspx

I think I’m close, but I’m getting the following:

‘Building target: OF’
‘Invoking: MinGW C++ Linker’
g++ -L"F:!code\eclipse\personal\of_preRelease_v007_win_cb\libs\fmodex\lib" -o “OF” ./main.o ./testApp.o
./main.o: In function main': F:\!code\eclipse\personal\OFoffline\OF\Default/../main.cpp:8: undefined reference toofAppGlutWindow::ofAppGlutWindow()’
F:!code\eclipse\personal\OFoffline\OF\Default/…/main.cpp:9: undefined reference to ofSetupOpenGL(ofAppBaseWindow\*, int, int, int)' F:\!code\eclipse\personal\OFoffline\OF\Default/../main.cpp:14: undefined reference toofRunApp(ofBaseApp*)’
./main.o: In function ~ofAppGlutWindow': F:/!code/eclipse/personal/of\_preRelease\_v007\_win\_cb/libs/openFrameworks/app/ofAppGlutWindow.h:16: undefined reference tovtable for ofAppGlutWindow’
F:/!code/eclipse/personal/of_preRelease_v007_win_cb/libs/openFrameworks/app/ofAppGlutWindow.h:16: undefined reference to `vtable for ofAppGlutWindow’
collect2: ld returned 1 exit status
make: *** [OF] Error 1

**** Build Finished ****

I have the regular CodeBlocks download version in Eclipse as a project and another project for the test app that references the OF one and includes the source from emptyExample. I created it as a makefile HelloWorld project and replaced the source. Both projects have includes for all the libs[…]\include and all the libs\openframeworks[…]. In the openFrameworks project Eclipse shows an error in libs\openframeworks\app\ofAppGlutWindow.h on line 16:

~ofAppGlutWindow(){}
undefined reference to `vtable for ofAppGlutWindow’

Maybe the OpenGL libs aren’t set up right in MinGW or something. Can anyone help with this?

I also fear it’s a opengl or glut problem. I would love to be able to help you, but I only use Eclipse on linux, and it works there. :-/