File Exchange

image thumbnail

Deploying a Shared Library

version 1.0.0.1 (6.93 KB) by

Example code for "Deploying Shared Libraries" posting in the "Art of MATLAB" blog.

20 Downloads

Updated

View License

This example code contains the source code for an application that encrypts and decrypts messages using the Vigenere cipher. The application consists of a C++ main program and several MATLAB functions. The MATLAB functions must be built into a C++ shared library by the MATLAB Compiler (see the blog post for details).
To build and run this example, you'll need:
* MATLAB
* The MATLAB Compiler
* A C++ compiler (gcc or Visual Studio).

Comments and Ratings (3)

Shachar

fan feng

Thuong

Thuong (view profile)

Thank you for sharing codes,
when I build MVS project, the following errors occur:
1>ClCompile:
1> vigenere.cpp
1>vigenere.obj : error LNK2019: unresolved external symbol _mclTerminateApplication_proxy referenced in function _main
1>vigenere.obj : error LNK2019: unresolved external symbol _libvigenereTerminate referenced in function _main
1>vigenere.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl decrypt(int,class mwArray &,class mwArray const &,class mwArray const &)" (__imp_?decrypt@@YAXHAAVmwArray@@ABV1@1@Z) referenced in function _main
1>vigenere.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl encrypt(int,class mwArray &,class mwArray const &,class mwArray const &)" (__imp_?encrypt@@YAXHAAVmwArray@@ABV1@1@Z) referenced in function _main
1>vigenere.obj : error LNK2019: unresolved external symbol _libvigenereInitialize referenced in function _main
1>vigenere.obj : error LNK2019: unresolved external symbol _mclInitializeApplication_proxy referenced in function _main
1>vigenere.obj : error LNK2019: unresolved external symbol _mclGetEmptyArray_proxy referenced in function "public: __thiscall mwArray::mwArray(void)" (??0mwArray@@QAE@XZ)
1>vigenere.obj : error LNK2019: unresolved external symbol _mclcppGetLastError_proxy referenced in function "public: static void __cdecl mwException::raise_error(void)" (?raise_error@mwException@@SAXXZ)
1>vigenere.obj : error LNK2019: unresolved external symbol _mclcppCreateError_proxy referenced in function "public: __thiscall mwException::mwException(void)" (??0mwException@@QAE@XZ)
1>vigenere.obj : error LNK2019: unresolved external symbol _ref_count_obj_addref_proxy referenced in function "public: __thiscall mwException::mwException(class mwException const &)" (??0mwException@@QAE@ABV0@@Z)
1>vigenere.obj : error LNK2019: unresolved external symbol _ref_count_obj_release_proxy referenced in function "public: virtual __thiscall mwException::~mwException(void)" (??1mwException@@UAE@XZ)
1>vigenere.obj : error LNK2019: unresolved external symbol _error_info_get_message_proxy referenced in function "public: virtual char const * __thiscall mwException::what(void)const " (?what@mwException@@UBEPBDXZ)
1>vigenere.obj : error LNK2019: unresolved external symbol _mclGetString_proxy referenced in function "public: __thiscall mwArray::mwArray(char const *)" (??0mwArray@@QAE@PBD@Z)
1>vigenere.obj : error LNK2019: unresolved external symbol _char_buffer_get_buffer_proxy referenced in function "public: __thiscall mwString::operator char const *(void)const " (??BmwString@@QBEPBDXZ)

Could you know how can i fix it.
Thank you!

Updates

1.0.0.1

Updated license

MATLAB Release
MATLAB 7.11 (R2010b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video