Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I was needing to use Mathlink to call some c++ code so I thought I would learn from the basic examples but I am running into strange issue. Following the procedure outlined from the Mathematica Documentation Center I attempted to do the very simple addtwo.exe build. I followed as exactly as I could(since this was written for Visual Studio 2010 some of the names of things weren't exactly the same). When I did the portion where you build addtwo using the Visual Studio Command Line Tools it works great. However, when I try to do the method outlined at "Using the Integrated Development Environment Visual Studio 2010" I get that it isn't able to find the right libraries. And get the following:

1>------ Build started: Project: addtwo, Configuration: Debug Win32 ------
1>addtwo.obj : error LNK2019: unresolved external symbol _MLMain referenced in     function _WinMain@16
1>addtwo.obj : error LNK2019: unresolved external symbol _MLInitializeIcon     referenced in function _WinMain@16
1>C:\Users\themadcemist\Documents\Mathematica     Mathlink\addtwo\addtwo\Debug\addtwo.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have moved, as directed by the tutorial, all the libraries etc. to their respective folders in the path "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC" (so \bin \lib \include). I am guessing perhaps I don't have something set up correctly it just confuses me that it would work with the Command Line but not with the IDE method. (I am following the 32 bit tutorial from the website)

share|improve this question
    
Possible duplicate of mathematica.stackexchange.com/questions/41682/…. –  Sjoerd C. de Vries Apr 9 at 18:54
    
I gave this a try but unfortunately it didn't work. Perhaps there is another file I would need to edit since 2013 isn't yet supported officially for Mathematica 9. It isn't imperative that I be able to use the IDE. –  user573214 Apr 9 at 20:45
    
How about this question then? Especially the comments about vcvarsamd64.bat. –  Sjoerd C. de Vries Apr 9 at 21:19
    
I tried this as well and it didn't help. I am not seeing where vcvarsamd64.bat is mentioned though? –  user573214 Apr 13 at 23:17
    
It's in the comments below the question. You have to fold open the list as it is partly hidden. –  Sjoerd C. de Vries Apr 14 at 5:25
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.