mwArray
API(C++03)를 사용하여 C++ 애플리케이션에 배포하기
mwArray
API를 사용하여 패키징된 MATLAB® 함수를 C ++애플리케이션에 통합이 접근법에서는 배포하려는 MATLAB 함수로부터 C++ 공유 라이브러리와 헤더 파일을 만듭니다. C++용 레거시 MATLABCompiler SDK™ API를 C++ 애플리케이션과 배포된 MATLAB 함수 간의 인터페이스로 사용합니다. mwArray
API를 사용하여 C++ 애플리케이션과 배포된 MATLAB 함수 간의 데이터 교환을 처리합니다. 배포된 MATLAB 함수를 C++ 코드 내에서 멤버 함수로 사용할 수 있도록, 생성된 헤더 파일을 전처리기 지시문을 사용하여 C++ 애플리케이션에 포함해야 합니다. 배포된 MATLAB 함수가 사용하는 MATLAB Runtime 인스턴스의 수명 주기를 명시적으로 관리해야 합니다. Runtime 인스턴스는 C++ 애플리케이션의 현재 프로세스 내(in-process)에서만 실행할 수 있고, 배포된 MATLAB 함수는 동기식으로만 실행할 수 있습니다.
C++ mwArray
API는 C++03 기능만 지원합니다. mwArray
API를 사용하는 C++ 공유 라이브러리에는 C 스타일 함수를 사용하여 MATLAB Runtime을 초기화하고, 패키징된 MATLAB 함수를 MATLAB Runtime으로 불러오고, C ++ 드라이버 코드와 MATLAB Runtime 간에 전달되는 데이터를 관리하는 인터페이스가 있습니다. 이 함수들에 대한 설명은 C/C++ API 아래에 나와 있습니다. C++ mwArray
API 아래에 나와 있는 함수들은 mwArray
API에 고유하며, 다른 API용으로 만든 공유 라이브러리에는 사용할 수 없습니다.
함수
compiler.build.cppSharedLibrary | Create C++ shared library (R2021a 이후) |
compiler.build.CppSharedLibraryOptions | Options for building C++ shared libraries (R2021a 이후) |
compiler.build.Results | Compiler build results object (R2020b 이후) |
mbuild | Compile and link source files against MATLAB generated shared libraries |
C/C++ API
mclmcrInitialize | Initialize the MATLAB Runtime proxy library |
mclInitializeApplication | Set up application state shared by all MATLAB Runtime instances created in current process |
mclTerminateApplication | Close MATLAB Runtime-internal application state |
<library>Initialize[WithHandlers] | Initialize MATLAB Runtime instance associated with
|
<library>Terminate | Free all resources allocated by MATLAB Runtime instance associated with
|
mclRunMain | Mechanism for creating identical wrapper code across all platforms |
mclIsMCRInitialized | Determine if MATLAB Runtime has been properly initialized |
mclWaitForFiguresToDie | Enable deployed applications to process graphics events so that figure windows remain displayed |
mclGetLastErrorMessage | Last error message from unsuccessful library initialization or MATLAB function call |
mclGetLogFileName | Retrieve name of log file used by MATLAB Runtime |
mclIsJVMEnabled | Determine if MATLAB Runtime was started with instance of Java Virtual Machine (JVM) |
mclIsNoDisplaySet | Determine if -nodisplay mode is enabled |
C++ mwArray API
mwArray | Class used to pass input/output arguments to C++ functions generated by MATLAB Compiler SDK |
mwException | Exception type used by the mwArray API
and the C++ interface functions |
mwString | String class used by the mwArray API
to pass string data as output from certain methods |
도움말 항목
요구 사항
- MATLAB Compiler SDK C++ Target Requirements
Review the software requirements for using MATLAB Compiler SDK to deploy MATLAB functions to C++ applications. - Setting Up C++ Development Environment
Set up development environment to develop C++ applications that integrate deployed MATLAB functions.
C++ mwArray
API 공유 라이브러리 생성하기
- Generate a C++ mwArray API Shared Library and Build a C++ Application
Create a C++ mwArray API shared library from MATLAB code and implement it with sample C++ driver code.
C++ 공유 라이브러리를 C++ 애플리케이션에 통합하기
- Call MATLAB Compiler SDK API Functions from C/C++
Use MATLAB Compiler SDK shared library functions in C and C++ code. - Integrate C++ Shared Libraries with mwArray
Write C++ code to reference shared libraries that use themwArray
API. - Create Sample Code to Call Exported Function
Generate sample code in C++, .NET, Java®, or Python® by including sample files during packaging. - Configure the mbuild Options File
How to configure thembuild
options file. - Use Multiple Shared Libraries in Single Application
Use multiple generated shared libraries in a single C/C++ application.
유지관리
- Memory Management and Cleanup
See recommendations on memory management. - Understand the mclmcrrt Proxy Layer
All application and software components generated by MATLAB Compiler™ and MATLAB Compiler SDK need to link against only one MATLAB library,mclmcrrt
. - Compilation Failures
List of possible failures during compilation. - Testing Failures
List of possible failures during testing. - Deployment Failures
List of possible failures during deployment.