Error while building a c++ library interface
7 views (last 30 days)
I am trying to build an interface to a C++ library I wrote following the procedure described here.
I define the missing constrcut and I receive no error whatsoever. However, when giving the command
I receive the following error
Error using clibgen.internal.buildHelper (line 75)
Build failed with error:
'C:/ProgramData/MATLAB/SupportPackages/R2021b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find
C:/ProgramData/MATLAB/SupportPackages/R2021b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find
collect2.exe: error: ld returned 1 exit status
Error in clibgen.LibraryDefinition/build (line 1406)
clibgen.internal.buildHelper(obj, obj.LibraryInterface, '', directBuild);
I actually do not undestand the error, since the files that cannot be found are there in the indicated folders. What am I doing wrong?
Walter Roberson on 26 Nov 2021
That is missing a space and also some other information.
There are two different options.
The -l (lower-case L) option needs to be followed by the name of a library to link into the object. An example of that is -llibMatlabDataArray which is saying that the libMatlabDataArray library needs to be located and linked into the object.
The -L (upper-case L) option needs to be followed by a directory name. The option indicates that the linker should add the given directory to the list of directories to search for libraries whose name have been given by -l (lower-case L) options.
Note that it is recommended that directory names with spaces in them be enclosed in double-quotes,