I have strange issue. When I invoking imported method with arguments from shared library, in those method I have wrong arguments. It's like:
x = 1; y = 2; z = 3;
(*method)(x,y,z);
In method I have:
void method(int x, int y, int z){
// x = 2, y = 3, z = 32432423 - something like this
}
Here how I do import:
QVector<int> (*interpolateValue)( int, int, int );
libHandle = dlopen( "plugins/libinterpolate.so", RTLD_LAZY );
*(void **)(&interpolateValue) = dlsym( libHandle, "_ZN11Interpolate16interpolateValueEiii" );
QVector<int> ys = (*interpolateValue)( lastY, newY, step );
I made work around about this in such way:
QVector<int> (*interpolateValue)( int*, int, int, int );
QVector<int> ys = (*interpolateValue)( NULL, lastY, newY, step );
But i think it's not a means.