not sure this is the best place to ask this, but I already asked in begginers and did not clarify me at all
i have OF v0.6 FAT version with the addons. I am trying to add XML addon to my working project (linux Codeblocks). I believe i need to select “workspace”, then go to Project > Build Options > and here i need to add the paths to the source and so on. But I dont fully understand what I have to add where.
i know i could get the xml example and start coding from there, but since i have already been coding for two days and i am using OSC addon as well, i guess i better get to understand this properly.
could anyone explain please, for example, what to add in “link libraries” list of paths, and also “search directories” list of paths for both compiler and linker.
I have added in all of them both folders “…/…/…/addons/ofxXmlSettings/libs” and “…/…/…/addons/ofxXmlSettings/src” but still get this error
testApp.cpp|24|undefined reference to `ofxXmlSettings::loadFile(std::basic_string<char, std::char_traits, std::allocator >)’|
…and so on… with all XML. functions.
i forgot to say i dont think i am doing an error in my programming. is a very simple piece of code
in linux there’s a simple way of adding addons by using the python script that you can find in scripts/ofProjectManager. once you install it, you can do from the command line:
ofProject create projectName
to create a project, or:
ofProject add projectName ofxXmlSettings
to add an addon from the addons folder with a well formatted install.xml file in it (all the official ones should work)
To add it manually it should be a matter of adding all the files of the addon to your project from: project>add files recursively … and selecting the directory where tha addon is. be careful not to add the example files inside the addon or you will end with a project with 2 testApps and to mains and it will fail when compiling.
and if, like me currently, you find half way though your project that you need to use a new addon. You would either start a project from scratch with ofProyect script and add all your source files manually, or add manually to your old project the addon source files.
then in my case i replaced with my own files the testApp.h, testApp.cpp and main.cpp, and finally added the extra files with other classes I had already coded.
Couple of things :
it would be great to have a readme.txt with instructions like this next to the script installer in the scripts folder.
it would also good to provide feedback to the user that the process of project creation or addon addition has been sucessfully end. In my case I got this warning when both creating and adding:
ofProject add oscVideoServer ofxOsc
/usr/lib/python2.6/sets.py:85: DeprecationWarning: functions overriding warnings.showwarning() must support the ‘line’ argument
stacklevel=2)
/var/lib/python-support/python2.6/amara/bindery.py:4: DeprecationWarning: the sets module is deprecated
import sets
for a second this made me confused because I thought that the script did not actually worked. Then I realise that it is just a warning. It did not help the fact that (to my knowledge) i did not know where the files where actually created. I found them after searching in my folders that it is actually a directory called MyApps at the same level as AddOnsExamples and Examples. This should go as well in any future documentation.
but maybe there is documentation and it is just me that did not find it? I only found that the ofProject prints the usage if you pass no arguments.
I am thinking on students or me after a sleepless night I would be happy to write the readme file and (try to insert) the feedback in the python scripts.
Sounds like you haven’t added the addon files to the project yet. As arturo said, right click the project and then select “add files” or “add files recursively”. Once you’ve imported them you may want to organise the addon files in virtual folders like the way there are done in the addon examples.
i think i have added them properly. the new project compiles now and everything works fine asd far as I can see. Both xml and osc addons work now.
about the feedback in the python script it would be just a matter of adding a line a the end of saveProject() at projectManager.py printing “done with project Blah” or more complex “succesfully added ofxOsc addOn to project Blah”.
thanks! now i have a much clearer idea of how to work with addons
oops… i am back home working with my desktop and i can see that the instructions popup when running the installer. Also I found the part of the general docs where it talks about the project manager. I must wait and tripple check before posting to the forum
i am going to watch it now. many thanks for your help!
this error occures in codeblocks. When i use the installer, i get two warnings:
/usr/lib/python2.6/sets.py:85: DeprecationWarning: functions overriding warnings.showwarning() must support the ‘line’ argument
stacklevel=2)
/usr/lib/pymodules/python2.6/amara/bindery.py:4: DeprecationWarning: the sets module is deprecated
import sets
But after applying this installer, i see that under “search directories”
Here is my build-log:
Compiling: src/main.cpp
Linking console executable: bin/advancedEventsExample_debug
/usr/bin/ld: cannot find -lofxXmlSettings
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 5 seconds)
1 errors, 32 warnings
The build-Log from the xml-example
Compiling: src/main.cpp
Linking console executable: bin/advancedEventsExample_debug
/usr/bin/ld: cannot find -lofxXmlSettings
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 5 seconds)
1 errors, 32 warnings