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.
- Create a new iOS app in Xcode
- File > Swift Packages > Add Pakage Dependency: Open3D-iOS
- Set header search path to let Xcode know where to find Eigen header files
- Add SceneKit framework dependency
- Add SCNView to storyboard
- 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)