ofxSyphon - framework copied - still not working

Hi,

Read the forum posts about ofxsyphon. But the answers did not work for me.

I have add the framework to the copy phase. But get this error:

  
duplicate symbol _main in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/main-82227D70F1DD098B.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/main-3E4823341560647C.o  
duplicate symbol __ZN7testApp5setupEv in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-FAA3DC9B2355198C.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-B6C9825E46D8747D.o  
duplicate symbol __ZN7testApp6updateEv in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-FAA3DC9B2355198C.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-B6C9825E46D8747D.o  
duplicate symbol __ZN7testApp4drawEv in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-FAA3DC9B2355198C.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-B6C9825E46D8747D.o  
duplicate symbol __ZN7testApp10keyPressedEi in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-FAA3DC9B2355198C.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-B6C9825E46D8747D.o  
duplicate symbol __ZTV7testApp in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-FAA3DC9B2355198C.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-B6C9825E46D8747D.o  
duplicate symbol __ZTI7testApp in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-FAA3DC9B2355198C.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-B6C9825E46D8747D.o  
duplicate symbol __ZTS7testApp in:  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-FAA3DC9B2355198C.o  
    /Users/Jochem/Library/Developer/Xcode/DerivedData/mySketch3-bfkmlcakvdonhscbfqmvyedmbcmu/Build/Intermediates/mySketch3.build/Debug/mySketch3.build/Objects-normal/i386/testApp-B6C9825E46D8747D.o  
ld: 8 duplicate symbols for architecture i386  
clang: error: linker command failed with exit code 1 (use -v to see invocation)  

It is an empty sketch, generated by the OF project generator. I’ve noticed if I let the genrator include the ofxsyphon project it makes the syphon.framework into a folder and it is impossible to include in the copy phase.

Running mountain lion. OF 704. Xcode 4

Thanks for your help in advance
j

I have not been able to use the project generator with syphon it never works. If you leave it out and add it manually after it always works.

Empty sketch, copy ofxSyphon-master into the addons folder, add framework to buildphase, same error :frowning:

It looks like what’s happening is that you’re compiling both your own code and the syphon example at the same time, in the same project. So, what’s happening is that your own testApp has a function called setup(), but then the example *also* has a file/object called testApp with a setup() function, etc etc. This is confusing the linker (hence “duplicate symbol”). Not your fault, you actually followed the instructions properly :slight_smile:

If you remove the “example” and “testapps” folders from your project, you should be good to go (assuming that my guess is correct, anyway). If that doesn’t work, try making a new project but only adding the “libs” and “src” folders from ofxSyphon (and the copy build phase with the Syphon framework itself).

Thanks!

i’m having this same problem, except i don’t have example and testApp
i used the 0.8.3 project generator and just tried to compile and empty app, and i get:

/Users/ali/Dropbox/Soft Dev/of_v0.8.3_osx_release/addons/ofxSyphon/libs/Syphon/src/SyphonNameboundClient.h:48:9: ‘Syphon/Syphon.h’ file not found

i’ve manually added the syphon.framework to the “link libraries with binary” in xcode, and manuuly added “SyphonNameboundClient.m” to my project

still getting this error:

That’s a different problem, actually. The originally posted issue was due to compiling an OF app and an example in the same project. It looks like your issue is just that the Syphon framework isn’t included in your project.

Or, rather, the Syphon frameworks’ header files location isn’t being established in your project. Usually Xcode takes care of this for you if the Syphon framework is included as a file in your project. (Right click in the file browser, “Add files to…”)

thanks admsyn
i added the framework manually (eventhough it’s already listed!) and it compiled successfully.

now i get:

dyld: Library not loaded: @loader_path/…/Frameworks/Syphon.framework/Versions/A/Syphon
Referenced from: /Users/ali/Dropbox/Soft Dev/of_v0.8.3_osx_release/apps/myApps/syphonExample2/bin/syphonExample2Debug.app/Contents/MacOS/syphonExample2Debug
Reason: image not found
(lldb)

another missing framework?

This probably means the framework isn’t copied to your app bundle for runtime. Click in the left-top on your project, go to ‘build-phases’ tab, go to ‘copy files’, click on the + to add the Syphon.framework file from your project.

Best,
V

1 Like