Operating System: Windows 8.1 Mathematica: 8 In possession of: Visual Studio 2013 and 2015

Had to alter the visual studios driver file within CCompilerDriver application, add-on so that it found the path for VS12.

After Executing: Needs["CCompilerDriver`"]; CCompilers[Full] I see that the $Automatic is set to my VS12 compiler, but am unable to create a lib from any CompilationTarget->"C" attempt.

When I examined the visual studios driver file, it declares calls to a skd7vcvars; I've loaded sdk7 (which complains about .Net4 not being on the computer and cannot be loaded due to Windows 8.1) and this does not generate the above mentioned batch file. (and sdk8.1 doesn't because they stopped including compilers with later SDKs)

Any thoughts???? I'm dying here.

  • $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory Tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$ – bbgodfrey Jul 5 '15 at 21:25
  • $\begingroup$ I guess you do not have access to newer Mathematica versions, right? If you do, I would definitely recommend upgrading to the latest version of Mathematica. $\endgroup$ – Wizard Jul 6 '15 at 12:25
  • $\begingroup$ How would this help? Calls to new batch files for more up-to-date sdk compilers from VS? If it wouldn't be too much poking, is the batch file defined early in your VisualStudio driver file not sdk7vsvars? My bossman has access to 10, would that solve all ills? Furthermore, if this is the case, then several places where sdk7 is proposed in the documentation and stack exchange need updated and/or replaced to conform to more relevant solutions. $\endgroup$ – Belphegor Jul 6 '15 at 20:06
  • $\begingroup$ I hate to say how much I love you, @Wizard... Moving to M10 does it, by magic... I'm going hunting for the driver files, to note the differences. $\endgroup$ – Belphegor Jul 7 '15 at 5:58
  • $\begingroup$ Glad it works. I do not have Mathematica running on Windows 8, so I can only check part of it. $\endgroup$ – Wizard Jul 7 '15 at 15:57

If you just care about dealing with this issue, @Wizard was correct. Install either Mathematica 9 or 10, problem solved.

If you care about Visual Studio 2015, read this: Installed Mathematica 10.0, the CCompilerDriver does not have a pre-built call system for VS2015, you will need to add this by appending lines to the CCompilerDriver.m file found at Mathematica//10.0//SystemFiles//Components//CCompilerDriver.m (REMEMBER TO SAVE A BACKUP IN CASE YOU BREAK IT!!) - the analogue solution to this for VS2013 is found at: C compilation not working with Visual Studio 2013 you just need to think, adapt and apply. Your saved backup cannot be in the same folder as the original.

If you care about the nuts and bolts, read this: The CCompilerDriver.m of Mathematica 10 is built to be backwards compatible, it has an entire section dedicated to SDK7 and SDK7.1 in case those are found on the machine. Else, it calls the more modern and stand-alone to VS batch file: Join[{installation, "VC", "bin", "vcvars"<>#<>".bat"}]&, {"64", "x86_amd64"} . It has to do that as the later versions of SDK, like SDK8.1, do not seem to include compilers in their packages.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.