-
Notifications
You must be signed in to change notification settings - Fork 57
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
Make build issues #32
Comments
@arturoc I wonder if you could comment on how this ought to work. I thought files in addons/ofxSyphon/src should be compiled automatically..? |
Possibly because files are .mm (Objective C++) rather than .cpp. |
I'm also having the same issue and no luck finding a solution so far.. |
I was able to partially compile the file using:
However, the resulting binary doesn't run and no frameworks are linked it. Tried to manually link Syphon framework (as well as all others required by OF) using LDFLAGS, with no success so far. Would anyone have a direction on how to solve this issue? |
@jeraman I just compiled the project code, I didn't add that flag. But I did change the the ofMain to this:
If you create a new project with the addon, make sure you copy the Syphon.framework to the project and to the bin directory |
Thanks for the update, @ThomasLengeling! I tried your suggestion but the problem persists. Maybe I'm missing something? What OS X version are you on? And what oF version are you using? |
I'ma using the GitHub release, and mac osx 10.12, what is your error output? |
Thanks for the info! I'm on OS X 10.11.6 and oF 0.9.8. I'll try to test in a setup similar to yours to see what happens. My output is exactly the same as the one posted by @bangnoise:
|
strange, make sure the .framework is linked to the project. I what I did, I created a new project with the projectGenerator and then included the .framework to the Xcode project, change the ofmain.cpp and included the .framework to the project bin directory. Hope that helps |
Oh, but the basic example compiles fine inside XCode, this is not my issue. The issue appears when I'm compiling it without XCode, by using a makefile. Is this what you're able to do? |
I managed to get a Makefile build with ofxSyphon I had to change the extension of the .m and .mm files in ofxSyphon/src and ofxSyphon/libs/Syphon/src and to .cpp - I can't work out why $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk isn't picking up the m's I copied the Syphon framework into /Frameworks in my project and then added PROJECT_LDFLAGS = -FFrameworks -framework Syphon I had to copy the framework into bin/my.app/Contents/Frameworks to run it (The examples in ofxSyphon don't build with recent OF because they use GLUT) |
Hi, is there any solution for visual code c++ complier? |
Looks like OpenFrameworks' compile.addon.mk needs to add support for .m and .mm files in addons. |
Will require this PR be merged openframeworks/openFrameworks#6652 - plus a change to copy the Syphon framework to the built app's Frameworks directory during builds, matching the behaviour of Xcode builds. |
As a followup, building is working for me with the oF 0.11.2 release and Xcode 13.2 on macOS 11.6.7 but runtime linking fails due to the missing framework:
It seems the Copy Frameworks step works fine when building with Xcode but either isn;t called or doesn't exist when using the Makefile build. This is strange as I thought the oF makefile build just invokes xcode build using the same project. The workaround is to manually copy the Framework into the app bundle but I would think it should be done automatically...? |
Ah sorry, I see y'all are aware of this already. An approach we took for installing libtensorflow dylibs into project app bundles for ofxTensorFlow2 is a script which is called with a custom makefile build target or during the Xcode build run script phase: https://github.com/zkmkarlsruhe/ofxTensorFlow2/blob/main/scripts/macos_install_libs.sh This is less than ideal though, because it requires manually adding this step after generating the project files: https://github.com/zkmkarlsruhe/ofxTensorFlow2#macos. I am working on an additional script to automate these steps but, still, not as nice as 1. generate project files & 2. make. |
I have my approach working in a client project which uses ofxSyphon: I basically follow the same model as ofxTensorflow2: script to install the framework into the bundle and special makefile targets to run this after generating the app. UPDATE: I'm pretty sure this breaks the code-signing but it's enough for the app to run on the build system. |
ofxSyphon source isn't being compiled for Makefile builds
Running make in example-Basic gives (shortened):
The text was updated successfully, but these errors were encountered: