astellato / ofxSyphon

An OF add-on for using the Syphon framework.
Other
193 stars 57 forks source link

Manually add ofxSyphon to Xcode #42

Closed crecord closed 5 years ago

crecord commented 5 years ago

Because of complications with other addons I need to install this one manually to my xcode project and I am having trouble.

I am using OF 9.8 on OSX 10.12.6 and I successfully compiled the example when I use the project generator. I tried to add ofxSyphon to my project by replicating the settings in the successful example project.

I did the following:

  1. Create the same file structure. Screen Shot 2019-04-03 at 2 03 09 PM

  2. Link the framework Screen Shot 2019-04-03 at 2 04 03 PM

  3. Add ../../../addons/ofxSyphon/libs/Syphon/lib/osxto framework search paths

  4. Add the following to header search paths.

../../../addons/ofxSyphon/libs
../../../addons/ofxSyphon/libs/Syphon
../../../addons/ofxSyphon/libs/Syphon/lib
../../../addons/ofxSyphon/libs/Syphon/lib/osx
../../../addons/ofxSyphon/libs/Syphon/src
../../../addons/ofxSyphon/src

These were all the custom setting I could find in the successful xcode project created by the project generated, but my new project won't compile. I get a bunch of Undefined symbols for architecture x86_64 errors.

Screen Shot 2019-04-03 at 2 07 48 PM

Are there additional step I should take to manually add ofxSyphon?

bangnoise commented 5 years ago

It is much simpler if you can use the Project Generator - what are the issues with the other addons?

It looks like the ofxSyphon files aren't being compiled for some reason - what's in the "Compile Sources" section of the "Build Phases" tab if you select the project in the left pane in Xcode?

crecord commented 5 years ago

The most complex and delicate of the addons is ofxTSNEParallel, which requires openMP, which was difficult to get running in xcode. It is both dependent on the version of LLVM and of xcode. Getting it working initially took a long time and has been difficult to reproduce.

Thanks for your suggestion of looking in "Compile Sources". The syphon files weren't being added to that list. All the other addon's .cpp files had been automatically added, but not for syphon. Perhaps because they are .mm instead of .cpp? I tried adding them manually and that results in a new error that is only the case if I manually include the files.

Screen Shot 2019-04-04 at 9 44 48 AM

It appears that including those files triggers an error finding a library needed for LLVM... The applications compiles successfully if I don't manually include those files and #include "ofxSyphon.h" and do not use ofxSyphonServer or ofxSyphonClient.

Just to test, I started a new project and added ofxSyphon manually and found that if I added the step of adding all the .m files manually to compile sources it worked just fine.

I realize that this error is super niche and most people won't be trying to manually include oxfSyphon while using openMP.But if you have any ideas of why this conflict might occur let me know.

bangnoise commented 5 years ago

This would appear to be a problem with your local installation of llvm, or an unhappy interaction between it and Xcode - supporting non-standard build environments is well beyond the scope of this project I'm afraid.