javaaddpath error from c++ shared library

조회 수: 4 (최근 30일)
Yoni Berk
Yoni Berk 2018년 5월 19일
Hello! I created simple function in MATLAB (the name of the func is meshgridC because before it did just meshgrid and when I changed it I forgot to change the name :P)
function meshgridC(vecX,vecY)
plot(vecX,vecY);
end
So I compiled it to C++ shared library and linked it to Visual Studio 2017.
#include "stdafx.h"
#include "meshgridC.h"
#pragma comment(lib, "libmat.lib")
#pragma comment(lib, "libmx.lib")
#pragma comment(lib, "libmex.lib")
#pragma comment(lib, "libeng.lib")
#pragma comment(lib, "meshgridC.lib")
#pragma comment(lib, "mclmcrrt.lib")
int main()
{
const int size = 100;
double x[size] = { 0 };
double y[size] = { 0 };
for (int i = 1; i <= 99; i++)
{
x[i] = x[i - 1] + 0.01;
y[i] = x[i] * x[i];
}
if (!mclInitializeApplication(NULL, 0))
{
fprintf(stderr, "An error occurred while initializing: \n %s ", mclGetLastErrorMessage());
return -1;
}
// Initialize the Vigenere library
if (!meshgridCInitialize())
{
std::cerr << "Could not initialize the library properly."
<< std::endl;
return -1;
}
mwArray rX, rY;
mwArray vecX, vecY;
vecX = x;
vecY = y;
meshgridC(vecX, vecY);
meshgridCTerminate();
mclTerminateApplication();
}
When the program gets to the meshgridCInitialize() function, it fails. It is writing me:
Undefined function or variable 'javaaddpath'
Could not initialize the library properly.
If I run it from debug, on mclInitializeApplication(NULL, 0) statement, Visual Studio writes me:
Frame not in module
The current stack frame was not found in a loaded module.
Source cannot be shown for this location.
00000266E9D103B4 mov eax,dword ptr [rsi]
How can I fix it? Thanks!

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by