I want to pass an argument into a C++ shared library lib.so form loader.exe.
Sorry, update the question.
shared library like:
int count(){
int num = 9;
int result = 0;
for ( int i = 0; i < num; i++ ){
result ++;
}
return result;
}
In the loader.exe, use a dlopen to load it.
void *handler = dlopen("lib.so", RTLD_LAZY);
I want to change the value of num from loader.exe. when I call the function count(), it can give me the new result.
How should I do?
thanks!