[Eclipse Windows] .bat for eclipse compilation

Hello,

I was looking for some eclipse compilation examples. I found some in the forum but only for mac or linux or with oldschools scripts that doesn’t work anymore.
It seems to be difficult for a beginner to have a working example compilation.

So I just finish a .bat file.

It creates .project and .cproject files in all “examples” directories.
You just have to create your workspace in the openframeworks root directory and “import existing project” within eclipse IDE.
Compile and voilà !

the .bat copies “data” folder in each example’s directory -I can’t have it work in the bin directory.
It also create a “copydll.bat” file for “post compilation” step. It copies all the dll in the Debug folder.

So if some of you can test it, it’s cool.

I’ll try to script this for linux later… it can work on mac too but I don’t own one :wink:

download and unzip openFrameworks_win32_cb_FAT file

unzip the eclipsofy.zip three files in the openFrameworks directory (c:\of_preRelease_v0.06_win32_cb_FAT/)

run the bat file

create a workspace directory in the openFrameworks directory

open Eclipse, “import existing project”, browse to an example folder, clic ok
Compile, run as “local application”

eclipsofy.zip

hey,

i tried to use your bat but every time i end up with this:

  
  
g++ -oadvancedGraphicsExample.exe src\testApp.o src\main.o openFrameworks\video\ofVideoPlayer.o openFrameworks\video\ofVideoGrabber.o openFrameworks\video\ofUCUtils.o openFrameworks\video\ofQtUtils.o openFrameworks\utils\ofUtils.o openFrameworks\utils\ofMath.o openFrameworks\sound\ofSoundStream.o openFrameworks\sound\ofSoundPlayer.o openFrameworks\graphics\ofTrueTypeFont.o openFrameworks\graphics\ofTexture.o openFrameworks\graphics\ofImage.o openFrameworks\graphics\ofGraphics.o openFrameworks\graphics\ofBitmapFont.o openFrameworks\communication\ofStandardFirmata.o openFrameworks\communication\ofSerial.o openFrameworks\communication\ofArduino.o openFrameworks\app\ofAppRunner.o openFrameworks\app\ofAppGlutWindow.o ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ ..\..\ -lopengl32 -lglu32 -ldsound -lwinmm -ldxguid -lstrmiids -luuid -lole32 -loleaut32 -lsetupapi -lwsock32 -lws2_32  
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: ..\..\: No such file: No such file or directory  

dont know where the “…” come from?!

any ideas?

yep, I don’t know why but it doesn’t work with “galileo” eclipse version…
With “ganymed” one it works.

in your .cproject file try to remove the “:/” in each ${workspace:/}
or remove those in the cproject.xml file and relaunch the eclipsofy.bat

edit: it does not work :confused:

thanks for your fast reply. will test it soon with ganymed.

Hi,

I’ve tried to get this working on Ganymede. When I open a project I get an error about the managed make file not being found. When I try to build the project nothing happens, no errors but no build either.

Any ideas on what I’m doing wrong?

Hi, Do you managed to compile an helloworld project on CDT ?

the “managed make file not be found error” appears when you move projects…
do you move examples after running the bat file ?

Hi,

Your right I didn’t have CDT setup correctly. I started again and followed this tutorial http://max.berger.name/howto/cdt/ which seems to have got me a little further.

I was getting problems with compiler finding certain files.

I’ve now edited the cproject.xml and removed ‘…/’ from most of the paths and it seems to be compiling. There are a few warnings at the end of the process:

  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized  
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized  
Warning: .drectve `/DEFAULTLIB:"LIBC" /DEFAULTLIB:"OLDNAMES" ' unrecognized  
..\copydll.bat  
  
C:\Users\VUser\Documents\OpenFrameworks\advancedEventsExample\Debug>xcopy ..\..\..\other\export\coreDlls_cbWin32 /s /y 	   
0 File(s) copied  
File not found - coreDlls_cbWin32  

The copydll.bat file seems to do it’s job if I execute it outside of eclipse though. After this is done the examples seem to work though. Seeing as I’ve had to remove ‘…/’ from the cproject.xml am i doing something wrong with the initial setup?

I try on a new pc with a “eclipse cpp ganymed” package and it works fine with the “emptyexample”, “advancedEventsExemple” and “graphics exemple”

I know that there are problems if your directories contain spaces path like “documents and settings”.

Your openframeworks folder should contain :

-addons
-apps
-libs
-other
-scripts
-workspace (eclipse workspace)
cproject.xml
eclipsofy.bat
project.xml

I can compile and launch as local application…

If you remove …/ from the cproject.xml some path may be broken. In eclipse some path are workspace relative and some others project relative.

Hi,

I was just making the openframeworks directory the workspace not creating a new workspace folder inside it, the paths are fine now.

There still seems to be a problem with copydll.bat when its triggered in eclipse but it works fine in the folder.

So everything seems to be in order, thanks for your help and getting this together in the first place, it really great.

happy to see that it not only work for me :wink:

Hi all,

First of all thanks a lot for this cool app!!

I’m interested make work together Eclipse & Of…

When i try to run the bat file all works fine. The import project to Eclipse looks good… but when i try to launch the program an error appear:

  
**** Build of configuration Debug for project emptyExample ****  
  
**** Internal Builder is used for build               ****  
g++ -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks\app -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks\communication -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks\events -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks\graphics -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks\sound -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks\utils -ID:\of_preRelease_v0061_win_cb_FAT\libs\openFrameworks\video -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks/app -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks/communication -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks/events -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks/graphics -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks/sound -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks/utils -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/openFrameworks/video -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/fmodex/inc -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/freeImage -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/freeType/include -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/freeType/include/freetype2 -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/glee/include -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/glu -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/glut -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/poco/includes -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/quicktime/CIncludes -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/rtAudio -ID:\of_preRelease_v0061_win_cb_FAT\workspace/../libs/videoInput/include -O0 -g3 -w -c -fmessage-length=0 -oopenFrameworks\video\ofUCUtils.o ..\..\..\..\libs\openFrameworks\video\ofUCUtils.cpp  
In file included from ..\..\..\..\libs\openFrameworks\video\ofUCUtils.h:4,  
                 from ..\..\..\..\libs\openFrameworks\video\ofUCUtils.cpp:1:  
D:/of_preRelease_v0061_win_cb_FAT/libs/openFrameworks/utils/ofConstants.h:47:21: glu.h: No such file or directory  
Build error occurred, build is stopped  
Time consumed: 816  ms.    
  

Maybe the error is about the version of the Of (Your app runs with the 006 and i try it with the last Of release…0061)

Is a release a problem?

Can you help me to run it in the new release 0061?

Thanks in advance for all your effort and for your cool app!!!