kewlbear / Open3D-iOS

Swift package for using Open3D in iOS apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use it in object-c project

CanCanZeng opened this issue · comments

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

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

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?

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

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

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)