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

use it in object-c project #15

Closed
CanCanZeng opened this issue Jun 5, 2021 · 6 comments
Closed

use it in object-c project #15

CanCanZeng opened this issue Jun 5, 2021 · 6 comments

Comments

@CanCanZeng
Copy link

Hi, is it possible to use the compiled xcframework in object-c project?

@kewlbear
Copy link
Owner

Yes, but you have to use Objective-C++ because Open3D is written in C++.

@CanCanZeng
Copy link
Author

Thank you for your kind reply!
Maybe I do not explain the problem explicitly, I fllow the guide in https://github.com/kewlbear/Open3D to compile Open3D myself, and it works, I get some xcframework files, but I do not know how to use it in object-c++ project. (by the way, I do no familiar with object-c++ very well, but know it better than swift, so I choose to use object-c++)
I find some infomation about how to use xcframework in object-c project, like https://stackoverflow.com/questions/65624785/use-xcframework-with-objective-c, they suggest to modify the code, is it the right way for me?

@kewlbear
Copy link
Owner

I've put together an example app. See https://github.com/kewlbear/Open3D-ObjC--Example. The following is the steps I made it.

  1. Create a new iOS app in Xcode
  2. File > Swift Packages > Add Pakage Dependency: Open3D-iOS
  3. Set header search path to let Xcode know where to find Eigen header files
  4. Add SceneKit framework dependency
  5. Add SCNView to storyboard
  6. Code ViewController.mm

@CanCanZeng
Copy link
Author

It's really sweet of you, I will try it later.

@willgittoes
Copy link

Just commenting to say thank you, those instructions worked perfectly for me!

I also needed to do these two things:

  • Link with libz.tbd under Targets > Build Phases > Link binary with library
  • Set the C++ language version to GNU++17 (I think 14 would have been fine though)

@thomas-graphopti
Copy link

Just commenting to say thank you, those instructions worked perfectly for me!

I also needed to do these two things:

  • Link with libz.tbd under Targets > Build Phases > Link binary with library
  • Set the C++ language version to GNU++17 (I think 14 would have been fine though)

hi, @willgittoes
where is the libz.tbd, I did not find this file.

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

4 participants