Hi All,
I need to call a function written using C++ into a static library ( .a file )
I am getting run time errors. I learnt from the help file that it is possible
External Function. This calls a function from a UNIX shared library, and may be used anywhere an expression can be defined. Any external function defined appear in the expression editor operand menu under Parallel Routines.
I have given the absolute path to the library, but it is giving me the error referenced symbol not found during runtime. The compilation of the job has gone thro fine.
Is the C++ compiler casuing name mangling to occur? Depending on the settings used by the compiler, c++ will add unusual symbols to the function name so that is can support two functions with the same name, but differnt parameter lists/types. In this case a function name GetMyFile might actually look like GetMyFile@@2332VVd@ or something else (this is compiler dependent). I haven't worked with parallel routines, but assuming that you have to tell it the name of the function you may have to add something like this to the function name. The person who wrote the function should be able to tell you if this is happening.
From the quoted statement in the original post it appears that you can used shared libraries (.*.so) but not static libraries. I have used external C function earlier but they were all dynamic libraries.
I am not sure if this observation was helpful but I thought I should share it.
When we tried initially, we were also getting this error "Referenced Symbol Not Found". After compiling again with CC (C++) Compiler (Datastage Documentation says the external library should be shared library created by using CC compiler) , the code worked. I'm not sure whether you can call a static library from a parellel routine.
The question on whether static libraries can be called, the answer is no, it can not be called. Dynamic shared objects, on the other hand, can be called.
-T.J.
Developer of DataStage Parallel Engine (Orchestrate).