Build error with iOS 11.4, SDK 0.8


#1

Seeing the following linking errors with SDK 0.8. Project builds fine with SDK 0.7.1, but simply swapping out the framework for SDK 0.8 generates the following errors:

Undefined symbols for architecture x86_64:
“oc::tGwaFqz3::addWeakTracker(std::__1::unique_ptr<oc::Tracker, std::__1::default_deleteoc::Tracker >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int, oc::t0iAWyGp*, oc::xH1ms5LR*, bool)”, referenced from:
l3694 in Structure
“oc::tGwaFqz3::trajectorySimilarity(std::__1::shared_ptroc::eo1xpH1n const&, std::__1::shared_ptroc::eo1xpH1n const&, double, double)”, referenced from:
l3693 in Structure
“oc::tGwaFqz3::tGwaFqz3(oc::tGwaFqz3::stt09zCX const&)”, referenced from:
l3694 in Structure
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Have followed directions here https://medium.com/@jianshi_94445/setting-up-structure-sdk-in-swift-with-xcode9-for-using-structure-sensor-d93313320db3 with no joy.

Have checked framework with lipo -info and looks like it does gave the correct architecture, so assume it is missing an additional framework somewhere.

Project is Swift 11.3, 4.1


#2

Sorry it has taken me so long to reply. We have noted this issue to our developers and will be addressing this issue as soon as we can, if an easy solution presents itself. Once we do, we will update the Structure SDK on our downloads page, as well on here on the forums.

We appreciate your patience!


#3

Hi @anthony.monaco - any possibility you could make the previous stable build available?
I have only recently purchased a structure sensor, and have no access to a functioning SDK given that 0.8 is broken… your website doesn’t appear to list previous versions.
So, for now… I’m dead in the water…

Thanks,


#4

Sure!

Could you give us a little more details about the issues you have been having, @teg? Details like iOS device used and iOS version would be fantastic. Thanks!


#5

Thanks Anthony - at the moment I havent even gotten a device involved, I just couldnt build at all. Same error as Andy above…


#6

Hmm, well just to let you know, using Swift with our Objective-C based SDK isn’t directly supported in the sense that we aren’t going to directly test our SDK to be used with Swift.

It seems the post you are following has not yet been updated for the Structure SDK 0.8. I would reach directly out to the creator of the Medium post to see if they has any suggestions as to get it to work with the newest version of the SDK.

To clarify my reply to Andy, if there is a simple bug or issue with our SDK that prevents it from being used with Swift 4, we will make a fix.

I would also take a look at the following pages for more information about how the Structure SDK can work with Swift:

Hope this helps!


#7

I’ve been using Swift 4.x since February with both SDK 0.71 & 0.8 and the latest iOS SDK. I see no difference between building an app using Swift or Objective-C. My Swift port on available on github is written for Swift 4.0. It will run on Swift 4.1 but requires about 6 minor changes to get it to compile using Swift 4.1.


#8

After further investigation looks to be something with project build settings and paths to frameworks. Unsure right now exactly which change I made fixed the issue, but something in the Bridging-Header.h and/or in the Target Build Settings.

Have a look at the project linked here, Will there be Structure SDK written in Swift 4?, and take a close look at where yours differs, especially around the Linking section.

In the end I basically recreated the Build Settings from that project in my own, tweaking where I needed to get my project building again. Best guess is it’s be something to do with LD_RUNPATH_SEARCH_PATHS and similar.


#9

Good to hear you got it going. The project https://github.com/n6xej/RRStructureScannerSwift4 is the one I wrote and am still use as the base for my Swift based projects. I think I have the path to the StructureSDK framework set, even thought I don’t include it, so it might have been looking in the wrong place.