Matlab error on Windows

14 views
Skip to first unread message

Santosh Shanbhogue

unread,
Mar 4, 2026, 6:22:16 PM (8 days ago) Mar 4
to Cantera Users' Group
Hi all,

I am able to succesfully install the experimental matlab package on Windows 11 and Matlab 2025. However I can't use it as matlab can't find the dll. Even if I move to the directory where the dll is located and use ct.load() I get the same error

Any help would be appreciated. The installation log is below

Thanks,
Santosh

Paths used in the build process:
Cantera Toolbox Root: C:\Repositories\cantera\interfaces\matlab
Include Directory: C:\Repositories\cantera\interfaces\clib\include
Cantera Library: C:\Repositories\cantera\build\lib
Output Folder: C:\Repositories\cantera\interfaces\matlab/+ct/+impl
Using shared library: C:\Repositories\cantera\build\lib\cantera_shared.dll
MEX configured to use 'Microsoft Visual C++ 2022' for C++ language compilation.
C++ compiler set to 'Microsoft Visual C++ 2022'.
Definition file definectMatlab.m contains definitions for 431 constructs supported by MATLAB.
- 327 constructs are fully defined.
- 104 constructs partially defined and commented out.

To include the 104 undefined constructs in the interface, uncomment and complete the definitions in definectMatlab.m.
To build the interface, call build(definectMatlab).
Building interface file 'ctMatlabInterface.dll' for clib interface 'ctMatlab'.
Build Log:
cl /c /Zc:__cplusplus /Zp8 /GR /W3 /EHs /nologo /MD /O2 /Oy- /DNDEBUG -I"C:\Repositories\cantera\interfaces\clib\include" -I"C:\Program Files\MATLAB\R2025b\extern\include" "C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.cpp" /Fo"C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.obj"
ctMatlabInterface.cpp
C:\Program Files\MATLAB\R2025b\extern\include\MatlabDataArray\detail/ReferenceHelpers.hpp(412): warning C4996: 'std::complex<int8_t>::complex': warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning.
C:\Program Files\MATLAB\R2025b\extern\include\MatlabDataArray\detail/ReferenceHelpers.hpp(412): note: the template instantiation context (the oldest one first) is
C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.cpp(308): note: see reference to function template instantiation 'matlab::data::ArrayElementRef<true>::operator T(void) const<std::complex<int8_t>>' being compiled
with
[
T=std::complex<int8_t>
]
C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.cpp(308): note: see the first reference to 'matlab::data::ArrayElementRef<true>::operator T' in '`anonymous-namespace'::mwCppGetScalarValue'
with
[
T=std::complex<int8_t>
]
C:\Program Files\MATLAB\R2025b\extern\include\MatlabDataArray\ArrayElementRef.hpp(120): note: see reference to function template instantiation 'std::complex<int8_t> matlab::data::detail::castTo<T,true>(std::shared_ptr<matlab::data::detail::ReferenceImpl>)' being compiled
with
[
T=std::complex<int8_t>
]

link /nologo /DLL "C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.obj" "C:\Repositories\cantera\build\lib\cantera_shared.lib" "C:\Program Files\MATLAB\R2025b\extern\lib\win64\microsoft\libMatlabDataArray.lib" /OUT:"C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.dll" "C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabmeta_res.res"
Creating library C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.lib and object C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.exp


---
Interface file 'ctMatlabInterface.dll' built in folder 'C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab'.

To use the library, add the interface file folder to the MATLAB path.
addpath('C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab')
Execution mode 'ctMatlab' set to 'outofprocess'. To modify, call clibConfiguration('ctMatlab','ExecutionMode','inprocess').
 Copied 1 run-time library files to 'C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab'
C:\Repositories\cantera\build\lib\cantera_shared.dll

 Run-time dependencies copied to interface library folder.
addpath('C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab')
>> ct.load
Unable to load interface library:
'C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.dll'. Reason: The
specified module could not be found.
Ensure the C++ dependent libraries for the interface library are added to run-time path.

Error in
ct.impl.getString

Error in
ct.version (line 9)
v = ct.impl.getString('mCt_version');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
ct.load (line 48)
fprintf('Cantera %s is ready for use (%s mode).\n', ct.version, mode);
^^^^^^^^^^
Related documentation
>> ct.load()
Unable to load interface library:
'C:\Repositories\cantera\interfaces\matlab\+ct\+impl\ctMatlab\ctMatlabInterface.dll'. Reason: The
specified module could not be found.
Ensure the C++ dependent libraries for the interface library are added to run-time path.

Error in
ct.impl.getString

Error in
ct.version (line 9)
v = ct.impl.getString('mCt_version');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
ct.load (line 48)
fprintf('Cantera %s is ready for use (%s mode).\n', ct.version, mode);
^^^^^^^^^^
Related documentation

Ray Speth

unread,
Mar 6, 2026, 2:25:52 PM (6 days ago) Mar 6
to Cantera Users' Group

Hi Santosh,

In the error message you’re getting:

Unable to load interface library:

‘C:\Repositories\cantera\interfaces\matlab+ct+impl\ctMatlab\ctMatlabInterface.dll’. Reason: The


specified module could not be found.
Ensure the C++ dependent libraries for the interface library are added to run-time path.

The statement “The specified module could not be found.” doesn’t actually mean that ctMatlabInterface.dll couldn’t be found. This is a confusing message that Windows generates when any of the dependencies of a DLL are not found, but it unhelpfully does not specify what dependency it couldn’t find. For that, you’ll need to use a tool like Dependencies to explore what ctMatlabInterface.dll is linked against.

I’m not sure how you compiled Cantera, but if it is linked against libraries in a Conda environment, you may just need to add the library directory from that environment to your PATH (the Windows PATH, not Matlab’s search path) in Matlab before loading the Cantera library.

Regards,
Ray

Reply all
Reply to author
Forward
0 new messages