Tag Info

Hot answers tagged

12

There are a few problems with your code. If you fix those up, as I did, your program will run fine. First off, the reason you see "no source available" when you pause the program is probably that when you break, the program is down inside a MathLink function, and so it is complaining that it doesn't have access to the MathLink library source code. To debug ...


4

As Szabolcs says, the problem is that you aren't linking with the MathLink libraries. The docs you cite give a method of doing this, but you might find it easiest (and it's easiest to explain) to simply add the ml32i4m.lib file to your Visual Studio project. (Use ml64i4m.lib, of course, if you are building a 64-bit program.) Right-click on your project in ...


3

Yes, you can. This would involve transferring the matrix to Mathematica, invoking the multiplication function, then transferring the result back. Doings this for the kinds of small (4 by 4 and 3 by 3) matrices that come up in your application area is going to be slower than either using pure Mathematica or pure C++ (due to the transfer) take more ...


3

Then let me give you a minimal example using LibraryLink. Create a file named my_vector.cpp (it is in my "tmp" folder here). #include "mathlink.h" #include "WolframLibrary.h" #include <vector> DLLEXPORT mint WolframLibrary_getVersion(){ return WolframLibraryVersion; } DLLEXPORT int WolframLibrary_initialize( WolframLibraryData libData) { return ...


3

There are a lot of def functions in the header file "WolframCompileLibrary.h", which make the type conversion very easy and straight forward. I'm using Mathematica version 8. For example, the following functions can be used to get data from the MTensor variables, they will return pointers to the basic m types such as mint, mreal, or mcomplex from the ...


2

This is a linking error, not a compilation error. It occurs because the linker can't find MLEvaluate(): the documentation states that MLEvaluate() is only available for use in mprep MathLink template programs. That's because this function is defined in the C source output by mprep when processing a template files. Template files apply only when you ...


2

The data types defined for LibraryLink are just simple typedefs for standard data types. --> see WolframLibrary.h typedef int mint; /* 32-bit architecture */ typedef long long mint; /* 64-bit architecture */ typedef double mreal; The MArgument_setter and MArgument_getter are just simple #defines for accessing the union MArgument: typedef union { ...



Only top voted, non community-wiki answers of a minimum length are eligible