File Exchange

image thumbnail

Deploying a Shared Library

version 1.0.0.1 (6.93 KB) by Peter Webb
Example code for "Deploying Shared Libraries" posting in the "Art of MATLAB" blog.

4 Downloads

Updated 01 Sep 2016

View Version History

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).

Cite As

Peter Webb (2021). Deploying a Shared Library (https://www.mathworks.com/matlabcentral/fileexchange/29443-deploying-a-shared-library), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Shachar

fan feng

Thuong

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!

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!