Hi Terence,
As per my understanding the error can be resolved by placing the compiled library file in the folder with the built interface file before calling the interface file.
Please refer to the following code for better understanding of the solution:
% Setup
hFile = 'C:\GitFolder\Project_C\MyDLL\MathLibrary\MathLibrary\MathLibrary.h';
libFile = 'C:\GitFolder\Project_C\MyDLL\MathLibrary\x64\Debug\MathLibrary.lib';
libname = "MathLibrary";
% Generate definition file for C++ library
clibgen.generateLibraryDefinition( ...
hFile, ...
PackageName=libname,...
Libraries=libFile, ...
ReturnCArrays=false,...
OverwriteExistingDefinitionFiles=true);
%% Build the interface files
build(definematrixOperations);
summary(defineMathLibrary);
addpath(libname);
%% Copy Library File to Interface Folder
dllPath = 'C:\GitFolder\Project_C\MyDLL\MathLibrary\MathLibrary\MathLibraryInterface.dll';
copyfile(dllFile, libname, "f")
doc clib.matrixOperations
Please refer to the following link for more information:
clibgen.generateLibraryDefinition
Hope this helps!
Thank You
Maneet Bagga