# Dll Importers using VS 2015 Express

**URL:** <https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269>\
**Category:** SketchUp SDK\
**Created:** [October 13, 2015, 8:38pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269 "2015-10-13T20:38:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim\_foltz](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jim_foltz/32/74787_2.png) [@jim\_foltz](https://forums.sketchup.com/u/jim_foltz)\
**Post date:** [October 13, 2015, 8:38pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/1 "2015-10-13T20:38:03Z")

</div>

I just wanted to understand correctly - I can not compile a dll importer using Visual Studio Express 2015 because SketchUp (the .exe) requires the dll importer be linked against the 2010 visual studio c++ runtime libraries?

---

<div class="post-metadata">

**Author:** ![bugra](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/bugra/32/33481_2.png) [@bugra](https://forums.sketchup.com/u/bugra)\
**Post date:** [October 14, 2015, 2:35pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/2 "2015-10-14T14:35:01Z")

</div>

Jim, please take a look at [this post](http://forums.sketchup.com/t/visual-studio-2013-build/15688/3) and [this one](http://forums.sketchup.com/t/debug-dll-of-exporter-plugin/14328/4). Your understanding is correct, a dll importer/exporter must run on the same C++ runtime as SketchUp. However, it sounds like you had compilation problems? I would expect the DLL to build just fine but crash in runtime.

---

<div class="post-metadata">

**Author:** ![jim\_foltz](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jim_foltz/32/74787_2.png) [@jim\_foltz](https://forums.sketchup.com/u/jim_foltz)\
**Post date:** [October 14, 2015, 9:00pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/3 "2015-10-14T21:00:50Z")

</div>

I misused the word “compile.” I was able to create the dll using VS2015 but it did indeed crash SketchUp quickly.

From what I understand, it’s just not possible to use VS2015 to create a dll linked against the version 100 run time libraries, and I would need to purchase a license for Visual Studio 2010.

What I want to attempt is to re-write the pure-Ruby .stl importer using c or c++ to make it faster. I want to use the [Open Asset Import Library](https://github.com/assimp/assimp) to handle converting the file to a mesh. Assimp has the added bonus of numerous file formats which could also be supported for SketchUp. I am under the impression creating a dll importer is the best or recommended way to develop this importer?

I was able to create a command-line converter using assimp which converts a supported 3d model file to a .skp file. The converter works well and is fast, as I had hoped. My next step was going to be to create the dll importer based on the command line code. But unfortunately, this does seem possible with the tools I have available.

The dependence on a specific (an old) version of Visual Studio seems like a very limiting barrier to developing extensions. It is for me, anyway.

Am I correct and if so are there any alternative ways to write this importer?

---

<div class="post-metadata">

**Author:** ![bugra](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/bugra/32/33481_2.png) [@bugra](https://forums.sketchup.com/u/bugra)\
**Post date:** [October 14, 2015, 9:37pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/4 "2015-10-14T21:37:49Z")

</div>

The problem here is that the importer/exporter API exposes C++ objects (like std::string). Since C++ doesn’t yet have a standard binary interface, different compilers will not necessarily be interoperable. When we upgrade SketchUp to VS2015, for instance, there will still be developers who wish to use VS2013, etc. So, one robust way to solve this would be to change the API to a C API. And that brings obvious back-compatibility issues.

Long story short, you do need VS2010 if you’d like to write an importer/exporter DLL. The only other option is to write a command-line executable and call it from a Ruby extension.

---

<div class="post-metadata">

**Author:** ![jim\_foltz](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jim_foltz/32/74787_2.png) [@jim\_foltz](https://forums.sketchup.com/u/jim_foltz)\
**Post date:** [October 15, 2015, 10:27am UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/5 "2015-10-15T10:27:02Z")

</div>

Thanks for the reply, @bugra. I am starting to understand. So not only are there binary incompatibilities between libraries built using different tools, but also incompatibilities even between different versions of the same tools. I found this article helpful. [http://www.mingw.org/wiki/Interoperability\_of\_Libraries\_Created\_by\_Different\_Compiler\_Brands](http://www.mingw.org/wiki/Interoperability_of_Libraries_Created_by_Different_Compiler_Brands)

Can you tell me if a dll importer adds geometry to the open model directly, or does it create a temporary skp file and then imports?

---

<div class="post-metadata">

**Author:** ![bugra](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/bugra/32/33481_2.png) [@bugra](https://forums.sketchup.com/u/bugra)\
**Post date:** [October 15, 2015, 2:13pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/6 "2015-10-15T14:13:36Z")

</div>

Sure Jim, my pleasure. That link explains things very well.

> [@jim\_foltz](#):
>
> Can you tell me if a dll importer adds geometry to the open model directly, or does it create a temporary skp file and then imports?

Both importers and exporters deal with temporary skp files, not the live model. SketchUp gives an importer/exporter a path to a temp skp file to write to or read from.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [October 15, 2015, 7:54pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/7 "2015-10-15T19:54:57Z")

</div>

> [@bugra](#):
>
> Long story short, you do need VS2010 if you’d like to write an importer/exporter DLL. The only other option is to write a command-line executable and call it from a Ruby extension.

@jim_foltz: Various StackOverflow answers refer to “set the Platform Toolset in project settings within Visual Studio” when the project is to be compiled for an older runtime version. (But I would suppose that the older SDK versions would need to be installed on your system, so VS would be able to add them to the selection listing.)

Microsoft info:  
[VS Forums: Possible to compile for older runtimes?](https://social.msdn.microsoft.com/Forums/vstudio/en-US/8cb43f2e-b386-42f7-8a3e-6a379d9c5f8c/possible-to-compile-for-older-runtimes?forum=vcgeneral)  
[MSBuild Multitargeting‎](https://msdn.microsoft.com/en-us/library/vstudio/ee395432(v=vs.100).aspx)  
[Breaking Changes in Visual C++‎](https://msdn.microsoft.com/en-us/library/bb531344.aspx)

[Searching MSDN for “VS compile against older runtime”](https://social.msdn.microsoft.com/Search/en-US?query=VS%20compile%20against%20older%20runtime&pgArea=header&emptyWatermark=true&ac=5)

---

<div class="post-metadata">

**Author:** ![jim\_foltz](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jim_foltz/32/74787_2.png) [@jim\_foltz](https://forums.sketchup.com/u/jim_foltz)\
**Post date:** [October 15, 2015, 7:57pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/8 "2015-10-15T19:57:11Z")

</div>

> [@DanRathbun](#):
>
> (But I would suppose that the older SDK versions would need to be installed on your system, so VS would be able to add them to the selection listing.

Correct, I would still need Visual Studio 2010 (not Express edition.) As far as I can tell, this setting just allows a more recent version of VS to use the tools from an older and installed version.

---

<div class="post-metadata">

**Author:** ![jim\_foltz](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jim_foltz/32/74787_2.png) [@jim\_foltz](https://forums.sketchup.com/u/jim_foltz)\
**Post date:** [October 15, 2015, 8:00pm UTC](https://forums.sketchup.com/t/dll-importers-using-vs-2015-express/16269/9 "2015-10-15T20:00:26Z")

</div>

The `clang++` compiler from the LLVM project aims for binary compatibility

> Clang attempts to be ABI-compatible meaning that Clang-compiled code  
> should be able to link against MSVC-compiled code successfully. - [source](http://clang.llvm.org/docs/MSVCCompatibility.html)

Although I don’t know enough about it to know if clang would work for me for create a dll importer.
