openFrameworks code samples

Yes, they are all broken because of the addons. No, there’s not really anything I can do about it at this point. The addons changed after I wrote the book and until there’s a second edition, it’s a glaring eyesore and believe something I rue daily. However, there’s plenty that you can do! On XCode this is a cinch.

First, anywhere that you see this:

#include “ofAddons.h”

remove it. Second, whatever the main .h of the addon that you want to use, include it. For example, if you want to use the ofxNetwork addon, you’d add:

#include “ofxNetwork.h”

Is that it? Yep. That’s it. As long as you have the include and the folder included for your compiler you’re good to go. That part is a little bit more IDE specific. On XCode it’s a cinch. On CodeBlocks it’s also a cinch but slightly more complicated. Look here for more info and feel free to ask questions. Enjoy!

5 Responses to “openFrameworks code samples”

  1. Theo writes:

    This issue is now fixed for the 0061 release on the download page of the openframeworks site.
    If you have an old 0061 release re-download it and the code samples should work perfectly.

    Theo

  2. peebeebee writes:

    Hi!
    Is it possible that the inclusion of ofMain.h is not longer needed for addons? I always get ‘no such file or directory’ error when it is implemented in an addon. :s
    any clues?

  3. admin writes:

    I think it still is. Check your paths?

  4. David writes:

    Hi, I’m new to Code::Blocks and am going through the books examples; I’m also getting this ‘ofMain.h: no such directory’.
    The code i’ve typed in is identical to the books. Does anyone know the problem?

    Thanks!

    -Dave

  5. admin writes:

    Sounds like that’s an error from your project being configured incorrectly. The best thing to do would be to check out the openframeworks forum

Leave a Reply