Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Trouble using visual studio 2010 to build c shared library example

Asked by Michael Kaiser on 30 Nov 2012

I've completed the c-shared library example: http://www.mathworks.com/help/compiler/c-shared-library-target.html which works fine using mbuild:

mbuild matrixdriver.c libmatrix.lib

The difficulty comes trying to build with Visual Studio 2010.

I get a bunch of linker LNK2019 errors, e.g.:

Error	1	error LNK2019: unresolved external symbol _mclTerminateApplication_proxy referenced in function _run_main	Y:\Documents\work\matlab\misc\projects\CShLib\matrixdriver_EmptyProj\matrixdriver_EmptyProj\matrixdriver.obj	matrixdriver_EmptyProj

In the project properties, Linker/Input, I've set additional dependencies: libmatirx.lib

Linker/general, Additional Library Directories: C:\Program Files %28x86%29\MATLAB\R2012b\extern\lib\win32\microsoft

project properties/C/C++/General, Additional Include Directories: C:\Program Files %28x86%29\MATLAB\R2012b\extern\include

What am I missing?

I plan to do some fairly complex work and really need the Studio 2010 IDE.

Thanks,

M

0 Comments

Michael Kaiser

Products

1 Answer

Answer by Michael Kaiser on 27 Dec 2012
Accepted answer

I've worked through this and have produced a "how to" document, which can be found in my (public) dropbox:

https://dl.dropbox.com/u/64275032/Studio2010WithMatlabDLL.pdf

I hope others find this useful.

-M

0 Comments

Michael Kaiser

Contact us