Creating a shared library from MATLAB

Hello, I am trying to create a shared library using the MATLAB compiler, to be accessed with my C++ code in Visual 2010 C++. MATLAB created the library but when I try and access is from VC++ I get the errors below. Not sure why it is happening. I am pretty sure I linked to everything properly. Any help would be appreciated. thanks!
Errors: error LNK2028: unresolved token (0A000662) "extern "C" ... and error LNK2019: unresolved external symbol "extern "C"

댓글 수: 1

Kaustubha Govind
Kaustubha Govind 2012년 1월 31일
Which function is the error about? (There typically is a function name listed after the "extern "C"" part. It looks like you did not add required library dependencies to the Linker options.

댓글을 달려면 로그인하십시오.

답변 (2개)

Walter Roberson
Walter Roberson 2012년 1월 30일

0 개 추천

That suggests to me that you attempted to compile C++ code with a C compiler.
Please uses
mex -setup
and in particular ensure that you are not using lcc (which is C only.)
Robert
Robert 2012년 1월 30일

0 개 추천

Thank you for your response. What is the difference between mex and mbuild? I am using mcc and not lcc.

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

질문:

2012년 1월 30일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by