kbw, HUGE, HUGE, HUGE thanks to you! Now it works at last.
I had 2 critical mistakes:
1) As you noticed, first argumet really was different types!
2) If you look now carefully, in main programm(that links shared library) was given
8 arguments, but librarry was set to accept
7 arguments
So as a result I got that "segmentation fault". Thanks to you once again! As only I made a header file with
1 2 3 4
|
extern "C" {
typedef int InitiateModuleType(char *mode, const MonolithMode *monomode, ModuleOutput *output, const Kingmaker *url, const Ambassador *ambassador,
Tesla *tesla, string a);
}
|
as you recommended, compiler immideately showed me errors because of types mismatch. It was great idea to make a header file, otherwise compliller was unable to check if types are the same or not.
PS. Could you give me some advice about how to make it all work in C++ style(not mixed as you said)? Actually dlsym is OS specified and isn't a part of ANCI C++. Where could I take a look for more information?