Unable to link SketchupAPI.framework in Xcode

mac

#1

I have a C extension that provides some utilities. It works on both Windows and Max OS X. I have decided to add an SDK call to Get Extension License. I was successful on Windows, but I’m not familiar with the Mac’s Xcode.

The Mac SDK has a file called SketchupAPI.framework,
MacFinder_19913

(You can see it is the SDK Mac_16-0019913)

Following the steps at:
http://docs.onemobilesdk.aol.com/ios-ad-sdk/adding-frameworks-xcode.html

I can put in Xcode (Xcode Version 9.3 on macOS High Sierra 10.13.4) as follows:

After a building, I’m seeing the following errors:

If I add the framework, won’t Xcode automatically find the binarie(s)?

Is it possible now a days to license a version of the SDK that includes the “Hello_World” example with pre-configured Visual Studio and Xcode projects?


#2

I think the README for the examples says it has code projects presetup …


#3

Github does not have any Sketchup SDK headers or binaries that I can find, at least the “dev-xcode8” branch.

That makes sense because you have to become a licensed developer (which I am) and download the SDK from Sketchup’s website. The Github source should include the SDK headers (which are online and no reason not to include them), and insert stub files for the SDK binaries. Alternatively, it would be nice if the SDK download from Sketchup’s website would include at least one buildable example.


#4

You asked specifically about the project files.

They are in the ruby-c-extension-examples repo’s following directory …
"https://github.com/SketchUp/ruby-c-extension-examples/tree/master/Hello%20World/SUEX_HelloWorld.xcodeproj"

The Visual Studio project files are in it’s parent directory, … ie …
https://github.com/SketchUp/ruby-c-extension-examples/tree/master/Hello%20World

Totally disagree. Why because they do not belong there. If they did do this it would create a precedent and therefore complicate every example they’d publish. Ie, links their SDK source headers to every example repo.


#5

Okay, there are no predefined project files with the SketchupAPI.framework. How do I fix my linker error?


#6

Can you copy the error with the full message? The screenshot clips parts of it.

The ThirdParty folder in the Ruby C Extension example have headers and libs for both Win and Mac.


#7

I have deleted the project and started with an earlier baseline as I was seeing many build errors eventually. Most related to my lack of Xcode knowledge, and adding files to a single target instead of all Ruby targets. I have stubbed out the SDK calls for now and am working other implementation.

Looking at the ThirdParty Frameworks in Xcode, I see the Ruby frameworks for all three targets, but I don’t see it initialized with a Sketchup SDK framework.


#8

Yea, the Ruby C Extension example doesn’t include the C API for licensing.

For that, have a look in the samples included in the SDK package;


#9

Oh, just realized that was a Visual Studio example only. You were looking at setting up XCode?
How far are you at? Where are you stuck?


#10

Yes Xcode. I’m more familiar with VS and I got it working.

I got it to compile by hardcoding the full path to the headers, including having to modify SDK headers because of their paths. Like the title says, I can’t get it to link.

I will try downloading the Mac SDK again and re-inserting the framework. I originally base lined from the GitHub Hello World project, which worked for a few years until I wanted to use the SDK. If I can’t get the framework to work correctly, I will base line from the Xcode project in the SDK examples.


#11

I’ve had problems before where I copied the framework on my Windows machine - which nukes the symbolic links. I then had to switch to my mac and clean out the broken framework and copy it again fresh from the mac os.


#12

I downloaded the Mac SDK from Windows and I may have down something to it before transferring it to the mac via thumb drive. I have been trying to re-download the Mac SDK. I have documented my problem at: