MathLink with MS Visual Studio 2008
- To: mathgroup at smc.vnet.net
- Subject: [mg85217] MathLink with MS Visual Studio 2008
- From: "Steve Luttrell" <steve at _removemefirst_luttrell.org.uk>
- Date: Sat, 2 Feb 2008 03:29:48 -0500 (EST)
I use Mathematica 6 with Windows Vista. I have just downloaded MS Visual C++ 2008 Express to set it up to work with MathLink. It installs itself along with the MS Visual Studio 2008 development environment. The documentation for Mathematica 6 (see tutorial/MathLinkDeveloperGuide-Windows) assumes you have MS Visual Studio 2005 (note 2005, NOT 2008), but I hoped that any differences between the 2005 and 2008 versions would be minor, so I set about getting the addtwo example to work. BTW, the prebuilt addtwo example works OK for me. I followed all of the instructions in tutorial/MathLinkDeveloperGuide-Windows for setting up an addtwo project without any problems, except for: (1) In the additional dependencies step (step 16 of the instructions) I found that ml32i3.lib does NOT exist, so I used ml32i3m.lib instead. (2) In the custom build step (step 21 of the instructions) I had to use explicit paths rather than the cleverly constructed paths that were suggested. I then built addtwo.exe, and there were no errors but a lot of warnings (see the transcript below). I then tried to install addtwo in a fresh Mathematica session, but the install hung up on me and never returned. Presumably there is an installation detail that is somehow different for the MS Visual Studio 2008 version (compared to the 2005 version), but there are so many things that I could tweak that I don't know where to begin. Can anyone help? addtwo build transcript: 1>------ Rebuild All started: Project: addtwo, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'addtwo', configuration 'Debug|Win32' 1>Performing Custom Build Step 1>Compiling... 1>addtwo.c 1>addtwotm.c 1>c:\users\steve luttrell\documents\temp\visual c++ 2008\addtwo\addtwotm.c(75) : warning C4133: 'function' : incompatible types - from 'char [7]' to 'LPCWSTR' 1>c:\users\steve luttrell\documents\temp\visual c++ 2008\addtwo\addtwotm.c(78) : warning C4133: 'function' : incompatible types - from 'char [260]' to 'LPWCH' 1>c:\users\steve luttrell\documents\temp\visual c++ 2008\addtwo\addtwotm.c(88) : warning C4133: 'function' : incompatible types - from 'char [7]' to 'LPCWSTR' 1>c:\users\steve luttrell\documents\temp\visual c++ 2008\addtwo\addtwotm.c(93) : warning C4133: '=' : incompatible types - from 'LPSTR' to 'LPCWSTR' 1>c:\users\steve luttrell\documents\temp\visual c++ 2008\addtwo\addtwotm.c(94) : warning C4133: '=' : incompatible types - from 'char [10]' to 'LPCWSTR' 1>c:\users\steve luttrell\documents\temp\visual c++ 2008\addtwo\addtwotm.c(100) : warning C4133: 'function' : incompatible types - from 'char [10]' to 'LPCWSTR' 1>c:\users\steve luttrell\documents\temp\visual c++ 2008\addtwo\addtwotm.c(100) : warning C4133: 'function' : incompatible types - from 'char *' to 'LPCWSTR' 1>addtwotm.c(480) : warning C4133: 'function' : incompatible types - from 'char [64]' to 'LPWSTR' 1>addtwotm.c(492) : warning C4133: 'function' : incompatible types - from 'char [64]' to 'LPCWSTR' 1>Generating Code... 1>Compiling manifest to resources... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Linking... 1>Embedding manifest... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Build log was saved at "file://c:\Users\Steve Luttrell\Documents\Temp\Visual C++ 2008\addtwo\Debug\BuildLog.htm" 1>addtwo - 0 error(s), 9 warning(s) ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== Stephen Luttrell West Malvern, UK