Unable to Install Microsoft Visual Studio 2010


#1

The threads on this forum provide directions for using the SDK. I registered as a developer, installed the SDK and then I went to:
http://www.sketchup.com/intl/en/developer/su-api/

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:

1>C:\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.


Installing Visual Studio 2010 Express on Windows 10
#2

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: https://www.microsoft.com/en-us/download/details.aspx?id=2680


#3

@thomthom I think that SDK is for writing extensions for Visual Studio.

You can still find find a VS2010 download but there was no express version at that time so you would still need to have a license to use it.

Edited: Incorrect.


#4

I downloaded:

It wouldn’t install, It looks like I need to install VS 2010 with a license. I think my current plan will be to use a DLL to speed some things up. (I was hoping to play with the C API, but I don’t think I actually need it). It has been a decade and a half since I created a DLL.


#5

You might want to try this link: http://stackoverflow.com/a/3061839/486990

Having said that, you can use other versions of Visual Studio - but you need to remember to ship the runtimes for VS2010 along with your app as well. (That’s the ones linked in the C API docs)


#6

Okay I downloaded the program at the URL. It was an ISO file, so I burned to CD and installed. 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-532-2002287-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:

  1>Project 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 http://go.microsoft.com/fwlink/?LinkId=291333.
  1>  RubyUtils.cpp
  1>  CreateLayOutExample.cpp
  1>  Generating Code...
  1>     Creating library C:\0_MISC\PROGRMNG\C Programs\VC10_Projects\SDK_Win_16-0-19911\samples\C++\RubyExampleCreateLayOut\Debug\CreateLayOutExample.lib and object C:\0_MISC\PROGRMNG\C Programs\VC10_Projects\SDK_Win_16-0-19911\samples\C++\RubyExampleCreateLayOut\Debug\CreateLayOutExample.exp
  1>LINK : 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:\0_MISC\PROGRMNG\C Programs\VC10_Projects\github_examples\Hello World\Hello World.vcxproj : warning  : Platform 'x64' referenced in the project file 'SUEX_HelloWorld' cannot be found. Please make sure you have it installed under '%VCTargetsPath%\Platforms\x64'.
  C:\0_MISC\PROGRMNG\C Programs\VC10_Projects\github_examples\SUEX_UsingSWIG\SUEX_UsingSWIG.vcxproj : warning  : Platform 'x64' referenced in the project file 'SUEX_UsingSWIG' cannot be found. Please make sure you have it installed under '%VCTargetsPath%\Platforms\x64'.

I tried to build it and had the following output:

2>Project not selected to build for this solution configuration 
1>  RubyUtils.cpp
1>  SUEX_HelloWorld.cpp
1>  Generating Code...
1>     Creating library C:\0_MISC\PROGRMNG\C Programs\VC10_Projects\github_examples\Debug (1.8)\SUEX_HelloWorld.lib and object C:\0_MISC\PROGRMNG\C Programs\VC10_Projects\github_examples\Debug (1.8)\SUEX_HelloWorld.exp
  1>LINK : 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?


#7

You can mount it - saving you from buring a physical disk. On newer Windows I think it’s even native:

Hm… I wonder - if Visual Studio Express came with 32bit out of the box. Not sure if they’d limited it to 32bit only or if you could download the 64bit SDK.
But for the sake of getting you started - can you try the Win32 config first and see if that works?


#8

I tired building a basic (non Sketchup SDK) console program and a windows one. I still see the error

LINK : fatal error LNK1123: failure during conversion to COFF

According to MSDN and stackexchange, this is a known problem when both VS 2010 and VS 2012 are installed. I need to investigate more.


#9

Bummer - I’ve not had 2012 installed. I jumped straight to 2013, now 2015.


#10

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 SUEX_HelloWorld, 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 “SUEX_HelloWorld.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?


#11

Shared object files are loaded with Kernel::require. It would be very good for you to read the description for it.
http://ruby-doc.org/core-2.0.0/Kernel.html#method-i-require

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 "BYoung_HelloWorld/Lib/SUEX_HelloWorld"

… 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 $LOAD_PATH 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 “Init_SUEX_HelloWorld” (ie, the same as the filename prepended with “Init_”.)


#12

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:

For the Ruby 1.8 builds it assumes SU2013 installed to standard location. For Ruby 2.0 I think I assumes 2014 - or 2015. (you’d have to check)

This means that if you hit F5 it should launch SketchUp and load the .so file from the build folder - allowing you to set break points and step through your C extension code.