Parallel Routine
Posted: Thu Mar 20, 2014 9:04 pm
Hi,
I am trying to convert names to camel case. I am trying to implement using the c++ code I found on this site (shown below). but when I am calling it from the parallel routine I am getting the below error. Can you please let me know what is the error meaning. I am pretty sure that it is able to find the routine because I have already tried a function that returns integer and its working fine. Just for your information I have used the options defined in the environment variables to compile and create shared objects using g++ compiler.
ERROR:
CPP code:
I am trying to convert names to camel case. I am trying to implement using the c++ code I found on this site (shown below). but when I am calling it from the parallel routine I am getting the below error. Can you please let me know what is the error meaning. I am pretty sure that it is able to find the routine because I have already tried a function that returns integer and its working fine. Just for your information I have used the options defined in the environment variables to compile and create shared objects using g++ compiler.
ERROR:
Code: Select all
Transformer_13: Failed to load the library "V0S13_casetester_Transformer_13.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 "V0S13_casetester_Transformer_13": /opt/IBM/InformationServer/Server/Projects/PJ/RT_BP469.O/V0S13_casetester_Transformer_13.so: undefined symbol: _Z7ConvMCTi.
Code: Select all
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "ctype.h"
char* ConvMCT(char *str) //Function with string input and string
{
char *result = new char[sizeof(str)*sizeof(char *)];
int x=0, Flag=1; // Setting Flag to 1 to make the first letter capital.
char CheckStr[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
while(*str)
{
if(Flag=1) //Check if the last character was not alphabet.
{
if(isalpha(*str) and islower(*str)) //Convert to uppercase if its a lower case alphabet.
{
result[x] = toupper(*str);
}
else
{
result[x] = *str; //No Change if its already in uppercase or not an alphabet.
}
}
else
{
if(isalpha(*str) and isupper(*str))
{
result[x] = tolower(*str); //Convert to lowercase except the first character.
}
else
{
result[x] = *str;
}
}
if(!strchr(CheckStr, *str)) //Check if the string is not a-z and A-Z.
{
Flag=1;
}
else
{
Flag =0;
}
++x;
++str;
}
result[x] = '\0'; //Terminate the string
return result; //Return the replaced string
}