The threads on this forum provide directions for using the SDK. I registered as a developer, installed the SDK and then I went to: and selected the 64-bit redistributable, which took me to Microsoft’s website. I installed the MS VS 2010 SP1 Redistributable Package, but it does not appear to have put VS 2010 on my computer.
It looked like something had installed, I have VS 2012 Pro on my computer, so I tried building “sample/C/ReadingFromAskpFile”. When it asked to upgrade to 2012, I said no. I tried building and I am seeing: 1C: Program Files (x86) MSBuild Microsoft.Cpp v4.0 V110 Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found.
To build using the v100 build tools, either click the Project menu or right-click the solution, and then select 'Update VC Projects.' Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. I went to Microsoft’s website, and it doesn’t provide a VS 2010 install, it only goes back as far as 2012. BruceYoung: I installed the MS VS 2010 SP1 Redistributable Package, but it does not appear to have put VS 2010 on my computer. The redistributable are the DLL required for you to distribute along with your application using the C-API. The C API library for Windows is built using Microsoft Visual Studio 2010 SP1. It includes both 32-bit and 64-bit binaries.
Building and releasing an application using the SketchUp C API for Windows requires including slapi.dll, which can be found in the SketchUp C SDK for Windows. Also, the following C runtime DLLs must be included: msvcp100.dll and msvcr100.dll. These must all be the appropriate 32-bit or 64-bit versions. Alternatively the Microsoft Visual C 2010 SP1 Redistributable Packages can used, which can be found here: It looks like MS removed VS2010 from their sites now - or it could be available from the MSDN sites. But I htink you should get away with just installing the SDK. Okay I downloaded the program at the URL. It was an ISO file, so I burned to CD and installed.
Aug 23, 2018 - You need install 'VC++ 2015.3 v140 toolset. The easiest way to get the v140 Platform Toolset is via the Visual Studio. All of 'Platform Toolset'.
The version is: Microsoft Visual Studio 2010 Version 10.0.30319.1 RTMRel Microsoft.NET Framework Version 4.5.51209 RTMRel Installed Version: VC Express Microsoft Visual C 2010 01013-5-70081 I deleted the initial SDK I had downloaded because I had tried using VS 2012 on it. I downloaded it again. I opened the project file for “CreateLayOutExample” from the samples folder.
The output was: 1Project file contains ToolsVersion='10.0'. This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons.
Treating the project as if it had ToolsVersion='4.0'. For more information, please see 1 RubyUtils.cpp 1 CreateLayOutExample.cpp 1 Generating Code. 1 Creating library C: 0MISC PROGRMNG C Programs VC10Projects SDKWin16-0-19911 samples C RubyExampleCreateLayOut Debug CreateLayOutExample.lib and object C: 0MISC PROGRMNG C Programs VC10Projects SDKWin16-0-19911 samples C RubyExampleCreateLayOut Debug CreateLayOutExample.exp 1LINK: fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt I had a similar problem with “ReadingFromAskpFile”. I tried opening the solution file for 3 different samples, but I can’t. I see the message box: 'The selected file is a solution file, but was created by a newer version of this application and cannot be opened.'
I don’t know what a solution file is, but why would I see that? I redownloaded the GitHub examples. I loaded, but did not build the “Hello World” project and observed the following warning: C: 0MISC PROGRMNG C Programs VC10Projects githubexamples Hello World Hello World.vcxproj: warning: Platform 'x64' referenced in the project file 'SUEXHelloWorld' cannot be found.
Please make sure you have it installed under '%VCTargetsPath% Platforms x64'. C: 0MISC PROGRMNG C Programs VC10Projects githubexamples SUEXUsingSWIG SUEXUsingSWIG.vcxproj: warning: Platform 'x64' referenced in the project file 'SUEXUsingSWIG' cannot be found. Please make sure you have it installed under '%VCTargetsPath% Platforms x64'.
I tried to build it and had the following output: 2Project not selected to build for this solution configuration 1 RubyUtils.cpp 1 SUEXHelloWorld.cpp 1 Generating Code. 1 Creating library C: 0MISC PROGRMNG C Programs VC10Projects githubexamples Debug (1.8) SUEXHelloWorld.lib and object C: 0MISC PROGRMNG C Programs VC10Projects githubexamples Debug (1.8) SUEXHelloWorld.exp 1LINK: fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt Build: 0 succeeded, 1 failed, 0 up-to-date, 1 skipped So I don’t seem to have made much progress. Do I need to build some sort of object files in the SDK before proceeding? Okay, I now have VS 2010 working. To get VS 2010 working I had to perform one of the stackoverflow fixes where “cvtres.exe” is replaced. I am now able to build my own simple console and windows programs in Visual Studio 2010 Express.
I then had compile and linker errors with the github SUEXHelloWorld, but the error messages were straight forward, I had to spell out a header path in another header, and I had to spell out the path to a linker library folder in the project properties dialog box. In the subfolder “Debug (1.8)” I have a file named “SUEXHelloWorld.so”. Now what do I do? The github folders don’t seem to have any directions.
Do I copy that file to Sketchup’s main “export” folder, or do I require it from a Sketchup ruby script? Shared object files are loaded with Kernel::require. It would be very good for you to read the description for it. And it is considered your library file for one of your particular plugins. So it would go somewhere in that particular plugin’s folder hierarchy. Ie: require 'BYoungHelloWorld/Lib/SUEXHelloWorld' where the relative path in the require call, is a subpath from the current working directory, or from one of the absolute paths in the $LOADPATH array. (See the method description for the order used for searching for a matching file to load.) You will also get a weirdly worded library error if the entry function is not named “ InitSUEXHelloWorld” (ie, the same as the filename prepended with “ Init”.).
BruceYoung: Now what do I do? The github folders don’t seem to have any directions.
Do I copy that file to Sketchup’s main “export” folder, or do I require it from a Sketchup ruby script? This should be located in your extension support folder - like Dan described. Note that under Windows you might get issues if you update on top over existing versions while SU is running because the file would be in use by SU. To work around that you can place them in versioned folder and update that whenever needed. Also note that you can debug from within the project by hitting Debug in VS. Notice how the Debugging is configured.