This post grew out of the August 2015 thread "ExportString and CreateExecutable" , notably from Ilian Gachevski's helpful replies.
The atch'd notebook comes from http://reference.wolfram.com/language/CCodeGenerator/tutorial/CodeGeneration.html (go to "Working with Generated Code") whose example creates an executable. The notebook is the example interspersed with comments that may be useful to some.
The main thing to note is that on my Windows 8.1 system running Mathematica 10.2, this example did NOT work when I used the Visual Studio Community 2015 compiler (https://www.visualstudio.com/downloads/download-visual-studio-vs). However, thanks to guidance received from a person who remains anonymous, I uninstalled VS2015 and installed Visual Studio 2013 (v12) from the same website. The documentation's example then worked -- the executable was created.
I was told that VS2015 has only recently come out (it's now 10 September 2015) and so apparently there are kinks to work out when used with Mathematica. There is one question, however: when I run testgenerate.exe, I get the Windows box "testgenerate.exe has stopped working..."
Does anyone know what causes this and how can it be avoided? Thanks.
Bruce
Attachments: