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

Can't run my program, because the framework isn't included. #225

Open
srbaker opened this issue Apr 2, 2022 · 1 comment
Open

Can't run my program, because the framework isn't included. #225

srbaker opened this issue Apr 2, 2022 · 1 comment

Comments

@srbaker
Copy link

srbaker commented Apr 2, 2022

Hi,

I am new to xcake.

(The Repo is over here: https://github.com/srbaker/Raphael)

I have the following Cakefile, and it references a framework which is built already that I just want to add to my project:

project.name = "Raphael"
project.class_prefix = "RAP"

application_for :osx, 10.11 do |target|
  target.name = "Raphael"
  target.all_configurations.each { |configuration|
    configuration.product_bundle_identifier = "com.stevenrbaker.raphael"
    configuration.settings["FRAMEWORK_SEARCH_PATHS"] = "../libs-renaissance/Source/**"
  }
  target.include_files << "../libs-renaissance/Source/Renaissance.framework"

  target.copy_files_build_phase "Embed Frameworks" do |phase|
    phase.files = [
      "../libs-renaissance/Source/Renaissance.framework"
    ]
    phase.destination = :frameworks
  end

  target.language = :objc
  target.type = :application
end

When I build and run in Xcode, it can't find the framework. And it's not added to the built app.

The error is:

dyld[30429]: Library not loaded: Renaissance.framework/Renaissance
  Referenced from: /Users/srbaker/Library/Developer/Xcode/DerivedData/Raphael-fgxqqojptmejsqhakvbdzhcssxdi/Build/Products/Debug/Raphael.app/Contents/MacOS/Raphael
  Reason: tried: '/Users/srbaker/Library/Developer/Xcode/DerivedData/Raphael-fgxqqojptmejsqhakvbdzhcssxdi/Build/Products/Debug/Renaissance.framework/Renaissance' (no such file), 'Renaissance.framework/Renaissance' (no such file), '/Library/Frameworks/Renaissance.framework/Renaissance' (no such file), '/System/Library/Frameworks/Renaissance.framework/Renaissance' (no such file)

I suspect this is a complete newbie error on my part. Thanks!

@igor-makarov
Copy link
Owner

igor-makarov commented Apr 3, 2022

Hey!

From the looks of it, you're building and linking your app successfully. Is the framework copied over to the Frameworks folder in the app bundle?

If so, my guess is the dylib loader is missing some rpath to know where to load Renaissance.framework/Renaissance from. However, I'm not a big expert on rpaths on macOS. I think you need to add @executable_path/../Frameworks to your LD_RUNPATH_SEARCH_PATHS build variable.

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

2 participants