0.04 + Code::Blocks (Porto workshop modifications)

Hello all,

I’ve just posted-online a package with the 0.04 version of OpenFrameworks for Code::Blocks with some modifications to make the whole package a bit more user friendly for the workshop.

Here’s the changelog:

* Code::Blocks was deleting rtAudio.o and GLee.o on project clean or
rebuild. Fixed by packing rtAudio.o into rtAudio.a and GLee.o into
GLee.a. Updated all example projects to use packaged libs.

* Post build steps were failing for the example code and presenting
a confusing error to the user although the code compiled fine. Fixed the
Code::Blocks variables used to build the path and comented out the post
build steps by default because export library copying is not needed to
run the app from inside Code::Blocks.

* Fixed all compiler warnings in examples, mostly due to declared
but unused variables and missing casts.

* Added a Linux version of the OpenCV addon and example code to the
package (this is a port of the 0.02 addon with libopencv 1.0 plus a
couple of changes needed for the workshop).

* Added a toplevel ‘docs’ folder to keep a static copy of the OF
documentation and a couple of help files on how to install Code::Blocks
and it’s dependencies on Ubuntu.

* Added an ‘ofRun.sh’ script to ‘export’ folder in an intial try to
use Code::Blocks’ target run options to run OF apps from inside CB.
This doesn’t work because CB check if the target is executable and
refuses to run executables as arguments to other executables. I still
feel this is the right way to do this, and I’ll try to work with
the CB devs to fix this.

* Fixed a compiler warning in the FOBS library header about missing
virtual destructors. This required building a new version of FOBS.

* Exposed the Joystick callbacks from GLUT to OF apps. Used the patch
found in the OF forum
(http://forum.openframeworks.cc/t/joystick-interface/418/0)

* Added a top level ‘tools’ folder to keep helper scripts. Right now
there’s only a quick’n’dirty installer script I used to install cb and
the dependencies on the 12 Linux PC’s used in the workshop, and a
wrapper script used for running OF apps from inside Code::Blocks. To
use the wrapper script you must start up Code::Blocks and change the
“Terminal to launch console programs:” field in Settings->Environment
from ‘xterm -T $TITLE -e’ to ‘xterm -T $TITLE -e
/path/to/your/of-install/0.04_cb/tools/cb_of_wrapper.sh’

Have fun,
P.

* Post build steps were failing for the example code and presenting
a confusing error to the user although the code compiled fine. Fixed the
Code::Blocks variables used to build the path and comented out the post
build steps by default because export library copying is not needed to
run the app from inside Code::Blocks.

thanks!!!

do you think you can you elaborate more on this problem?

I’m making 0.05 for CB and it seems to work for me for the newest version of codeblocks so not sure what the issue is…

thanks!
zach

Hi zach, sorry for taking so long to reply, but I was a bit swamped with work last week and couldn’t check the forum :confused:

As for the fix, in the original 0.04 code::blocks project files the post build steps were:

  
  
cp -r ../../export/libs $(TARGET_OUTPUT_DIR)bin/$(TARGET_NAME)  
cp ../../export/clickToLaunchApp.sh $(TARGET_OUTPUT_DIR)bin/$(TARGET_NAME)/clickToLaunchApp.sh  
sed -i s/applicationName/$(PROJECT_NAME)/g $(TARGET_OUTPUT_DIR)bin/$(TARGET_NAME)/clickToLaunchApp.sh  
  

The problem was that $(TARGET_OUTPUT_DIR)bin/$(TARGET_NAME) was being expanded to something like “…/example/bin/bin/example” which made the copy fail and present a confusing error to the user.

So I replaced these post-build steps by:

  
  
cp -r ../../export/libs $(TARGET_OUTPUT_DIR)  
cp ../../export/clickToLaunchApp.sh $(TARGET_OUTPUT_DIR)/clickToLaunchApp.sh  
sed -i s/applicationName/$(PROJECT_NAME)/g $(TARGET_OUTPUT_DIR)/clickToLaunchApp.sh  
  

And it worked flawlessly. I suspect that the meaning of these builtin variables probably changed between c::b versions and made this problem appear.

Cheers,
P.

thanks!

theo and I actually debugged this over the weekend, and discovered that there is a better variable to use, which should work across all CB versions.

we also crafted a shell script to launch the exe (if you want) as the last step of post build, so you can do a kind of “build & run” just by building. it works pretty well. alternatively, you can launch nautilus to the folder, or do nothing (which is default).

thanks much for the help and info !

  • zach