I am trying to use the M4RI package for C++. I downloaded the source for M4RI and ran the packaged VS project. It created m4ri.dll (no .lib files).
Now I want to “add” this dll file to a different VS2010 C++ project so I can use the M4RI library.
I already #include m4ri.h, but still get linking errors. How do I add this reference to the VS project?
Thanks in advance.
My solution:
I am not familiar with the differences between C and C++, but this seems to be the issue. To get the M4RI library to build, I had to explicitly tell it to compile with C++ (Properties->C/C++->Advanced->Compile As: “Compile as C++”)
I’m not sure if this caused my problem, or if it is unrelated.
To be able to use the library, I had to modify “m4ri.h” to remove the #ifdef __cplusplus sections. As soon as those precompiler directives were removed, I was able to link to M4RI easily.
I would appreciate if someone could explain why this fixed the problem.
Thanks!