Page 1 of 1

C++ Comand to compile a routine on solaris

Posted: Fri Sep 08, 2006 12:07 pm
by mab_arif16
Hi
I am trying to compile a C++ routine on solaris ,I used the command
g++ -O -fPIC mutiplyrtn.c -c -o mutiplyrtn.o , the object file is created ,after creating the routine through manger ,when used in transformer ,the job gets compiled but it fails at run time with error .

Transformer_3: Failed to load the library "V0S3_temp_Transformer_3.so"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S3_temp_Transformer_3": ld.so.1: osh: fatal: relocation error: file /opt/etl/Ascential/DataStage/Projects/BDR_DEVL/RT_BP3756.O/V0S3_temp_Transformer_3.so: symbol __1cIkeyWords6Fpc_0_: referenced symbol not found


Is it the right command to compile c++ code on soalris as I have some .o files and routines created by a contractor who left and they run fine
Thanks
Arif

Posted: Fri Sep 08, 2006 12:10 pm
by seanc217
Try the .o library instead and define that in DataStage as an object.
Let me know if this works for you.

I could not get a .so to work on Linux but the .o does!

Sean

Posted: Fri Sep 08, 2006 12:22 pm
by meena
Hi,
Check this post.

http://dsxchange.com/viewtopic.php?t=87 ... ee7882e274

And do a search on "ld.so.1: osh: fatal: relocation error: " with search all terms option,we have few posts discussed on this.

Posted: Fri Sep 08, 2006 12:24 pm
by mab_arif16
seanc217 wrote:Try the .o library instead and define that in DataStage as an object.
Let me know if this works for you.

I could not get a .so to work on Linux but the .o does!

Sean
when I used the command
g++ -O -fPIC mutiplyrtn.c -c -o mutiplyrtn.o
only a .o file is created,and in datastage manger object type I checked the Object radio button . and the library path as ../routines/myroutine.o.

Do I need to change something here to use .o library

Posted: Fri Sep 08, 2006 12:46 pm
by lstsaur
Hi Arif,
Command is correct. Check your Libray path of your Paralle Routine which is pointing to your .o file correctly.

Posted: Fri Sep 08, 2006 3:01 pm
by mab_arif16
Got it ,We need to use the following command format to generate object file
APT_LINKER APT_COMPILEOPT <<programme name>> -o objectfilename.o

APT_LINKER,APT_COMPILEOPT are the environment variables whose values can be obtained from administrator.
Thank you all who helped me solve this and ofcourse all DSXCHANGE team.

ARif