I am building an application consisting of the following, separate modules: - GAClient: a C++ executable - GAOrcl: a C DLL generated by Oracle Pro*C - GAEngine: a C++ DLL - MyGAUtils: a C++ library of functions
Here's how the different modules are related: - GAClient calls several functions from GAOrcl, and a few from MyGAUtils; - GAOrcl calls a few functions from GAEngine ("DoGATraining" is one of them) - GAEngine calls several functions from MyGAUtils
I have two similar instructions in GAClient.cpp:
double* vKaz=(double*)malloc(5*sizeof(double*));
and GAEngine.cpp:
double* vPastTarget=(double*)malloc(5*sizeof(double*));
My problem is, malloc works fine when called from GAClient, but subsequently crashes when called from GAEngine. Visual Studio debugger throws a "GAClient.exe has triggered a breakpoint" arror, and points me to a "lseeki64.c" source file, which I have no idea what is...
I suspect this might have something to do with the fact that DoGATraining is defined as an extern "C":
#define EXPORT __declspec(dllexport)
extern "C" EXPORT int __stdcall DoGATraining(int pPastDataCount, double* pPastData)
Any idea where I might start troubleshooting?