Main Content

Paths and File Infrastructure Setup

Compile Path Search Order

MATLAB®Coder™resolves MATLAB functions by searching first on thecode generation pathand then on the MATLAB path. The code generation path contains the current folder and the code generation libraries. By default, unlessMATLAB Coderdetermines that a function should be extrinsic or you explicitly declare the function to be extrinsic,MATLAB Codertries to compile and generate code for functions it finds on the path.MATLAB Coderdoes not compile extrinsic functions, but rather dispatches them to MATLAB for execution. SeeResolution of Function Calls for Code Generation.

Specify Folders to Search for Custom Code

If you want to integrate custom code — such as source, header, and library files — with the generated code, you can specify additional folder to search. The following table describes how to specify these search paths. The path should not contain:

  • Spaces (Spaces can lead to code generation failures in certain operating system configurations)

  • Tabs

  • \,$,#,*,?

  • Non-7-bit ASCII字符,如日本的性格cters

To specify additional folders Do this
Using theMATLAB Coderapp
  1. To open theGeneratedialog box, on theGenerate Codepage, click theGeneratearrow.

  2. ClickMore Settings.

  3. On thePathstab, in theSearch pathsfield, either browse to add a folder to the search path or enter the full path. The search path must not contain spaces.

At the command line Use thecodegenfunction-Ioption.

Naming Conventions

MATLAB Coderenforces naming conventions for MATLAB functions and generated files.

Conventions for Naming Generated Files

The following table describes howMATLAB Codernames generated files.MATLAB Coderfollows MATLAB conventions by providing platform-specific extensions for MEX files.

Platform MEX File Extension MATLAB CoderExtension for Static Library MATLAB CoderExtension for Shared Library MATLAB CoderExecutable Extension
Linux®(64-bit) .mexa64 .a .so None
Mac(64-bit) .mexmaci64 .a .dylib None
Windows®(64-bit) .mexw64 .lib .dll
Also, generates an import library with a.libextension that is required for linking against the.dll.
.exe

See Also

Related Topics