[SOLVED]How to add Code::Blocks libraries and linking questions

I’m new to Code::Blocks and programming on Linux and have a couple of questions:
My setup: Code::Blocks 10.05 running on Linux Mint 12 (Ubuntu 11.10), using oF 0071.

  1. How do I add addon libraries to my project? All of the examples on the net that I could find were for Windows Code::Blocks and the two GUIs are not the same.

  2. I recently bought a Kinect and wanted to compile and run the ofxKinectExample project. It appears that the project compiles but when it goes to link, I get

  
ld||cannot find -llibopencv_legacy.a|  

It also cannot find the other 12 *.a files in the opencv lib folder. I have added all of the opencv link libraries in the linker settings (see screenshot) but I still get the error.

Any help is appreciated. Thanks.

For your first question the simpliest way is to create a file addons.make with the name of your library inside(ofxOsc for example) next to your .cbp file.
After you can use it when you made a
#include “ofxOsc.h”
in your testApp.h file

Hello
I got Debian Wheezy and same configuration for CB and of.
I have exactly the same problem with linking, same list of static libraries not found, and I could not solve it with adding paths in settings ( compiler and debugger settings / Search Directories / Linker ).

I also tried to add in addon.make the following lines :
ofx3DModelLoader
ofxDirList
ofxNetwork
ofxOpenCv
ofxOsc
ofxThread
ofxVectorGraphics
ofxVectorMath
ofxXmlSettings
ofxAssimpModelLoader
ofxThreadedImageLoader
ofxUI

Thanks a lot to help !

No possible help ? still not found :frowning:

Currently the way addons are added is by adding them to the addons.make file in the project directory.
You don’t need to edit anything in Codeblocks (you used to have to, though not anymore)
For each addon, add the name of the addon to the addons.make file, one per line, e.g.
ofxOpenCv
ofxOsc

Then just compile. The codeblocks project just calls a makefile that does the rest of the magic.

If you are still getting errors, then something is wrong with your installation or setup. Try running the install_dependencies script in the Scripts/Linux/Ubuntu folder. Also, try running any addon example from the Examples/Addons directory.

By the way, there is also a plugin for Codeblocks Linux in the current development branch on github that will enable you to create a project using a wizard and add initial addons. Or you can use the projectGenerator, an OF project that generates other OF projects.

That did it. Thanks for the help.

  
ld||cannot find -llibopencv_legacy.a|  

Codeblocks cannot find the other 12 *.a files in the opencv lib folder. I have added all of the opencv link libraries in the linker settings (see screenshot) but I still get the error.

I’m still having the problem when I go to compile the ofxKinectExample code, Codeblocks cannot find the OpenCV libraries. ofxOpenCv is added to my addons.make file. Thanks.

The linking problem has been solved by bilderbuchi in the Beginners board: http://forum.openframeworks.cc/t/[solved]codeblocks-linking-problem/10850/0.

The problem was that the libsorder.make file in ofxOpenCv is formatted incorrectly. Making the changes in the bug report fixed the problem. The project now builds.