The Windows OS has a command-line limit of 32,767 characters. When building large projects, this limit may exceeded, especially during the linking step. Currently, this limitation applies to the clib build processes. However there are some workarounds that may help to avoid this issue:
1) Specify a short "OutputFolder" name. The example below shows how to specify the "OutputFolder" as "C:\".
clibgen.generateLibraryDefinition( hppFiles, "SupportingSourceFiles", sources, …"IncludePath", includePath, …"OutputFolder","C:\")
You can find the documentation for the "OutputFolder" name/value pair at the link below.
2) Use the Windows subst command to shorten path names. For example,
> subst b: c:\<very-long-path-name>
3) Break the code into smaller DLLs. For example, create a DLL outside MATLAB for portions of the code that do not require a MATLAB interface. These DLLs can be linked during the build. The example below illustrates a case where the static library foo.lib was created from a subset of the code and is linked to when building the MATLAB clib Interface.
clibgen.generateLibraryDefinition( hppFilesReduced,"Libraries", "foo.lib", ...
"SupportingSourceFiles", sourcesReduced, …"IncludePath", includePath, …"OutputFolder","C:\")