How Do I run examples on XCode ?
SasanBhrm opened this issue · 9 comments
Ho do I run examples from this project on XCode ? I only have main.app and two oter files in each directory (folder)
Thanks
One easy way is to use the openFrameworks project generator to create a new project (preferably with the same name as the example you want to use) and then replace the files it created with the files from the example folder.
@SasanBhrm Realized today there is actually an even easier way:
- open the openFrameworks project generator
- click the import button and select the example folder (so addons/ofxfacereader/example-blink for instance)
- click 'update' to let the generator create all the Xcode files
- use the popup to open the project or open it from finder/Xcode directly.
I've tried both these ways and can't get any examples to run. Specifically trying now example-align-eyes and I get this error:
'opencv2/opencv.hpp' file not found
I am running the example from the main addons folder. How do I get the dependencies into my project?
Did you see the list of dependencies in the readme? Make sure you download those and place them in the openframeworks addons folder. Then run the steps above and use the project generator to add them to the project (or add them manually by adding their name to the addons.make file (like ofxCv) and to your ofApp.h file (#include "ofxCv.h").
But the examples in this repo are already set up this way, so you might not have installed opencv?
Do I have to download all of the dependencies in the addons.make file? Or are they supposed to be imported automatically because they're listed there? Just tried to use the project generator to update a project after copying over the example files, and it says I am missing the ofxGui, ofxOpenCv and ofxOsc addons.
The readme just mentions the ofxCv, ofxTiming and ofxDelauny plugins as required downloads. I have downloaded ofxCv and placed it in the addons folder.
Thanks for your help!
What system are you on? Windows, Mac, Linux? And what version of OF are you using? Knowing this will help in giving you the right info to get set up.
ofxGui
and ofxOsc
should have come with your download of openFrameworks: they are in the addons
folder (and you should leave them there, you don't have to move them to your project folder or anything like that).
You might want to take a couple of steps back to make sure everything is set up correctly:
In the following steps I mention the openframeworks
folder. This is the folder you got when unzipping your download and is probably called something like of_v0.10.0_linux64_release
(or with mac
/ windows
in its name instead of linux64
, depending on your platform).
With all steps keep folders and projects where they are, as some scripts are location specific and they might not work when moved. You can start moving them when you're sure everything is ok.
- Inside the
openframeworks/apps/myapps
folder you'll find a project calledemptyExample
. Try running that one first. The output will only be a gray screen but getting it to run will tell you OF is found and compiled correctly. - If that worked, try the
openframeworks/examples/gui/guiExample
project. This will try to load theofxGui
addon (which came with OF) so you know if addons are found and included correctly. - Downlod or clone
ofxFaceTracker
into theopenframeworks/addons
folder and use the project generator to update theexample-empty
and create all project files you need. Again, leave the project where it is, don't move it to a different location yet. We first want to know if it is able to loadofxFaceTracker
and other necessary files. Make sure you follow the instructions in the readme about the model files you'll have to place into thebin/data
folder of theempty-example
project.
Thanks @javl! I was able to get the expression-example working following your instructions on my Mac. It seems that somehow all of the included openFrameworks addons were deleted from my addons folder, which is why openFrameworks could not find them.
Maybe this is more of an openFrameworks issue, but I think having the instructions you just gave me available in the main readme would be a huge help to those coming to ofxFaceTracker without much knowledge of openFrameworks/Xcode/c++.
Thanks again!
@trevorlitsey Though you're right more detailed instructions would have been helpful it's also a bit overkill to add them to the readme of every ofx addon. I think in most cases the addon authors expect you to already have a working setup, which seems reasonable.
Glad you got it to work. It's often helpful to first go all the way back to the most basic and bare bones example and start adding things from there so you can spot where the error appears.