Crear interfaz de MATLAB en biblioteca de C++
clibgen
Para crear (publicar) una interfaz de MATLAB en una biblioteca de C++, llame a la función clibPublishInterfaceWorkflow
. Para obtener una visión general de la interfaz, consulte Steps to Publish a MATLAB Interface to a C++ Library.
Para obtener información sobre cómo llamar a las funciones en la biblioteca desde MATLAB, consulte Utilizar interfaz de MATLAB predefinida en biblioteca de C++.
Funciones
clibPublishInterfaceWorkflow | Publish interface for C++ library in the Live Editor (desde R2023a) |
clibgen.generateLibraryDefinition | Create definition file for C++ library |
clibgen.buildInterface | Create interface to C++ library without definition file |
Tareas de Live Editor
Generar interfaz de C++ | Generate definition file for C++ interface library in the Live Editor (desde R2023a) |
Espacios de nombres
clibgen Package | Summary of namespaces and classes to support calling C++ library functionality from MATLAB |
Temas
Cómo publicar una interfaz
- What Types of Files Define Your Library?
How to set the arguments to theclibgen.generateLibraryDefinition
function. - Steps to Publish a MATLAB Interface to a C++ Library
Outline for publishing an interface to a C++ library. - Requirements for Building Interface to C++ Libraries
Requirements for calling functions in external, compiled C++ libraries from MATLAB.
Publicar interfaz en bibliotecas definidas por estos archivos
- Archivos de encabezado y de biblioteca compilada de C++ en Windows
Este ejemplo crea una interfaz de MATLAB en una biblioteca de C++ con un archivo de biblioteca de importaciónmatrixOperations.lib
. - Header and C++ Compiled Library Files on Linux
This example creates a MATLAB interface to a C++ library with a shared object filelibmwmatrixOperations.so
. - Header and C++ Compiled Library Files on macOS
This example creates a MATLAB interface to a C++ library with a dynamic shared library filelibmwmatrixOperations.dylib
. - Archivos de encabezado y archivos fuente de C++
Este ejemplo crea una interfaz de MATLAB en una biblioteca de C++ definida en los archivos fuentematrixOperations.hpp
ymatrixOperations.cpp
. - Header-Only HPP File
This example creates a MATLAB interface to a C++ library defined in a header fileschool.hpp
.
Definir y personalizar
- Define MATLAB Interface for C++ Library
Generate and edit the MATLAB library definition file to customize and define the interface.
- Publish Help Text for MATLAB Interface to C++ Library
Provide documentation for end-users of a MATLAB interface to a C++ Library.
Compartir su interfaz
- Distribute MATLAB Interface to C++ Library
How to share your MATLAB interface with MATLAB users.
- C++ to MATLAB Data Type Mapping
Correspondence of MATLAB data types to C/C++ types. - Lifetime Management of C++ Objects in MATLAB
MATLAB rules for managing memory for C++ objects created in a MATLAB interface to a C++ compiled library. - Initialize Pointer Members of C++ Structures for MATLAB Interface to Library
Verify that C++ class constructors initialize pointer members.
Solución de problemas
Build C++ Library Interface and Review Contents
If library functionality is missing, the library might contain unsupported language features or data types.
C/C++ library features not supported in MATLAB.
Troubleshooting C++ Library Definition Issues
Information for resolving error when publishing a MATLAB interface to a C++ library.
- Resolve Build Error: Multiple Redefinition Linker Errors
- Resolve Build Error: Unresolved External Symbols
- Build Error Due to Compile-Time Checks
- Errors Parsing Header Files on macOS
Debug C++ Library from MATLAB Interface
How to build a debug version of a MATLAB interface to a C++ library.