Error calling MATLAB engine in external library (error 6400)


Updated by Altair Forum User
Hello all,
I have a .dll library linked to a DRESP3 card in Optistruct. It works fine, except if I call the MATLAB engine. The relevant code is the following, related to the MATLAB engine API:
Engine *ep; if(!(ep = engOpen(NULL))) { } engClose(ep);
If I comment out the lines containing engOpen and engClose, the .dll works fine. If I uncomment them, Optistruct generates the following error:
*** ERROR # 6400 *** The following (Path Removed).dll external library could not be loaded: (null) Please verify that the library path, name and extension are correct. Also check that the library was compiled and linked with appropriate. flags on the appropriate platform. See OptiStruct's user guide for. more information about building and using external libraries.
I'm at a loss to what causes the error. If I comment out the mentioned lines, the .dll works (i.e. generates .txt files as output), so I don't think it's a compilation or linking issue. The only thing I could think of is that the MATLAB functions are mixed caps/non-caps. If this is indeed the issue, are there any suggestions for workarounds?
Kind regards,
Matthijs