Hauptinhalt

Erstellen einer MATLAB-Schnittstelle zu einer C/C++ Bibliothek

R2026b
Programmatisches Erstellen einer MATLAB®-Schnittstelle zu einer C oder C++ Bibliothek

Sie können eine MATLAB-Schnittstelle mit von Ihnen gepflegtem MATLAB Programmcode für eine C oder C++ Bibliothek erstellen (veröffentlichen). Geben Sie die einzuschließenden Kopfzeilen und Symbole an, ändern Sie nur die Definitionen, die MATLAB nicht inferieren kann und erstellen Sie die Schnittstelle für verschiedene Plattformen und Bibliotheks-Updates konsistent neu. Einen Überblick finden Sie unter How to Publish a MATLAB Interface to a C/C++ Library.

Rufen Sie alternativ clibPublishInterfaceWorkflow auf, um mithilfe geführter Schritte eine plattformspezifische Schnittstelle zu erstellen.

Informationen über den Aufruf von Funktionen in der Bibliothek aus MATLAB heraus finden Sie unter Verwenden einer vordefinierten MATLAB-Schnittstelle zu einer C/C++ Bibliothek.

Vor R2026b: Um eine Schnittstelle zu veröffentlichen, können Sie clibPublishInterfaceWorkflow aufrufen, um ein Workflow-Skript zu verwenden oder mithilfe von clibgen.generateLibraryDefinition eine Definitionsdatei für die Bibliothek erstellen. Weitere Informationen finden Sie unter How to Publish a MATLAB Interface to a C/C++ Library (R2026a).

Klassen

clibgen.api.InterfaceConfiguration Specify configuration for generating MATLAB interface to C/C++ library (Seit R2026b)
clibgen.api.InterfaceDefinitionInspect, customize, and build MATLAB interface definition for C/C++ library (Seit R2026b)

Funktionen

clibPublishInterfaceWorkflowCreate live script to publish platform-specific interface for C/C++ library (Seit R2023a)
clibgen.generateLibraryDefinition(Not recommended) Create definition file for C/C++ library
clibgen.buildInterface(Not recommended) Create interface to C/C++ library without definition file

Live Editor Tasks

Erstellen einer C++ SchnittstelleConfigure and generate MATLAB interface to C/C++ library (Seit R2023a)

Namespaces

clibgen.apiSummary of programmatic workflow objects for publishing MATLAB interface to C/C++ library (Seit R2026b)
clibgen(Not recommended. Instead use objects in the clibgen.api namespace.) Classes to publish MATLAB interface to C++ library using the clibgen.generateLibraryDefinition function

Themen

Definieren und individuell anpassen

Schnittstelle freigeben

Fehlersuche

Build C/C++ Library Interface and Review Contents

When you build a MATLAB interface to a C/C++ library, you can review the contents of the generated interface.

Limitations to C/C++ Support

C/C++ library features not supported in MATLAB.

Troubleshooting C/C++ Library Definition Issues

Information for resolving errors when publishing a MATLAB interface to a C/C++ library.

Troubleshooting MATLAB Interface to C/C++ Library Run-Time Issues

Resolve unexpected run-time errors when calling functions in a published MATLAB interface to a C/C++ compiled library.

Troubleshooting Calls to C/C++ Library Functions

Resolve unexpected issues when calling functions in a C/C++ compiled library.

Debug C++ Library from MATLAB Interface

How to build a debug version of a MATLAB interface to a C++ library.