How to convince Visual Studio to compile your C++ Alteryx tool

Tom Larsen
Mar 1 · 5 min read

There are many topics regarding Alteryx, data analytics, and coding which are fun and compelling to talk about. Topics which force you to think, give you ‘aha!’ moments, or make you glad you chose this line of work to define your contribution to society. This is not one of them.

When Alteryx announced they were deprecating the .NET SDK, my first reaction (after I cried a bit) was a bold, brave decision to abandon C# and learn C++. I know it is going to be tough, but I am willing to put in the time and effort to make it work. And Alteryx makes interfacing with their C++ SDK fairly easy. After all, a comment in the AlteryxPluginSdk.h header file gives this reassuring statement:

// This file represents the single header your plugin tools should include
// in order to interface with the Alteryx product.

So let’s do that! I will open Visual Studio, create a fresh, new project…

…and include the Alteryx plugin SDK header in my code file:

I’ll just build the project to make sure everything works, and…

Ok, it is not quite so easy as the header file would suggest. I spent an hour of my life comparing my project to the sample projects in the Alteryx API examples before I arrived at the magical fixes that will finally allow my empty project to….compile. Not solve world hunger or cure cancer, just compile. My precious hour which I splurge on myself so I can do cathartic activities like coding, 3D modelling, or reading. Stolen by a grumpy compiler. I’m a bit bitter right now, so let’s move on before I start saying things I will regret later.

The actual fixes to make a fresh project compile with the C++ SDK are quite simple and easy to implement. The first thing you need to do is change a single setting on your project. In Visual Studio, right-click on the project and select ‘Properties’:

Under "Configuration Properties" > "C/C++" > "All Options", change ‘Conformance mode’ to ‘No’. Note that I am doing all of this in the Release Configuration for the x64 platform, which is the same platform I am trying to compile.

What is Conformance mode and why is it causing my compiler errors? I have no clue. But compiling with this new setting gives us only 1 error:

It is a bit of a strange error because it seems a file is missing from the SDK. One of the include statements in EngineInterface.h is this (line 13 on my copy):

#include "Base/Src_Error.h"

That file does not exist in my copy of the SDK, which came from a vanilla install of Alteryx Designer. My solution was to simply to comment out the include statement:

//#include "Base/Src_Error.h"

You only have to do this once, and hopefully in the future Alteryx will fix this error.

EDIT: I brought this issue up with Alteryx, and it looks like the issue is limited to version 2018.4. The versions before and after 2018.4 do not have this include statement in EngineInterface.h.

Now when I compile I get more errors, but we are actually making some progress:

The rest of the errors are eliminated by adding a few lines to stdafx.h. This is the original version:

And this is stdafx.h after:

At last, my empty project builds:

Now I can create the classes and interfaces according to the rest of the SDK, build it, copy the DLL into Alteryx’s bin\Plugins folder, create the configuration and UI files according to the HTML SDK, and run it in Alteryx!

To summarize everything in one place, these are the steps I had to take before my empty project would build with the Alteryx SDK:

  1. Include the AlteryxPluginSdk.h header in my code file.
  2. Comment out #include “Base/Src_Error.h” from EngineInterface.h in the SDK.
  3. Change the project’s Conformance mode to ‘No’.
  4. Add the following lines to stdafx.h:
#undef min
#undef max

I hope this helps you avoid losing an hour of your life. Happy coding with the C++ SDK!

***Disclaimer: Struggling to build with outside libraries and SDKs seems to be a ‘thing’ in C++. There are so many variables that can affect the build. So if you are reading my post and are not using Visual Studio version 15.8.5, Windows SDK version 10.0.17134.0, platform toolset v141, and the Alteryx SDK from the 2018.4.5.55178 version of Alteryx, and you are not building an x64 Release build, then your mileage may vary. Heck, it may vary even if your setup is identical to mine…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade