Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Do I run examples on XCode ? #142

Open
SasanBhrm opened this issue Aug 12, 2017 · 9 comments
Open

How Do I run examples on XCode ? #142

SasanBhrm opened this issue Aug 12, 2017 · 9 comments

Comments

@SasanBhrm
Copy link

Ho do I run examples from this project on XCode ? I only have main.app and two oter files in each directory (folder)

Thanks

@javl
Copy link
Contributor

javl commented Mar 14, 2018

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
Copy link
Author

SasanBhrm commented Mar 14, 2018 via email

@javl
Copy link
Contributor

javl commented Mar 29, 2018

@SasanBhrm Realized today there is actually an even easier way:

  1. open the openFrameworks project generator
  2. click the import button and select the example folder (so addons/ofxfacereader/example-blink for instance)
  3. click 'update' to let the generator create all the Xcode files
  4. use the popup to open the project or open it from finder/Xcode directly.

@trevorlitsey
Copy link

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?

@javl
Copy link
Contributor

javl commented Jun 4, 2018

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?

@trevorlitsey
Copy link

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!

@javl
Copy link
Contributor

javl commented Jun 4, 2018

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.

  1. Inside the openframeworks/apps/myapps folder you'll find a project called emptyExample. 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.
  2. If that worked, try the openframeworks/examples/gui/guiExample project. This will try to load the ofxGui addon (which came with OF) so you know if addons are found and included correctly.
  3. Downlod or clone ofxFaceTracker into the openframeworks/addons folder and use the project generator to update the example-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 load ofxFaceTracker and other necessary files. Make sure you follow the instructions in the readme about the model files you'll have to place into the bin/data folder of the empty-example project.

@trevorlitsey
Copy link

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!

@javl
Copy link
Contributor

javl commented Jun 4, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants