Advertisement

11.30.2008 at 10:35PM PST, ID: 23945959
[x]
Attachment Details

compile C++ using GCC failed on AIX 5.3

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3
Tags:

IBM, AIX 5.3, C++, GCC

Hello experts,

I have a C++ file that needs to be compiled into a shared library. I could compile and use the output dll in Windows platform, but no success when i tried to compile it in AIX using GCC compiler.

My C++ code is composed of a few simple functions which reference some external library.

I've the error below:

ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(unsigned long, char)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::length() const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<char>::allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::str(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<char>::~allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream<char, std::char_traits<char> >::operator<<(int)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::str() const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status


Thanks in advance for your participation.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
#include <ctype.h>
#include <string>
#include <sstream>
#include <ctype.h>
#include <stdlib.h>
#include "edisnb.h"
#include "ediccb.h"
 
#ifdef __cplusplus
extern "C" { 
#endif 
 
typedef struct WORKAREA worka; 
struct WORKAREA 
{ 
	char working[4096];
}; 
 
int main (snb *snbdata, ccb *ccbdata, char *flddata, long *fldoffset, long *fldlength, worka *permarea,
		  char *temparea, long *templength){					
 
	std::string newValue;
	std::string result;
	std::string chrSign, convertedValue, strTemp;
	std::ostringstream buffer;
	int sign=1, intTemp=1;
	
	for(int i=0;i<*fldlength;i++){
		strTemp=flddata[i];
		if(strTemp.compare("è")==0){
			newValue=newValue+"e";
		}else{
			newValue=newValue+flddata[i];
		}		
	}
 
	for(unsigned int i=0;i<newValue.length();i++){
		if(isalpha(newValue[i])){
			sign=1;
			strTemp=newValue[i];
 
			if(strTemp.compare("{")==0){
				convertedValue="0";
			}else if(strTemp.compare("A")==0){
				convertedValue="1";
			}else if(strTemp.compare("B")==0){
				convertedValue="2";
			}else if(strTemp.compare("C")==0){
				convertedValue="3";
			}else if(strTemp.compare("D")==0){
				convertedValue="4";
			}else if(strTemp.compare("E")==0){
				convertedValue="5";
			}else if(strTemp.compare("F")==0){
				convertedValue="6";
			}else if(strTemp.compare("G")==0){
				convertedValue="7";
			}else if(strTemp.compare("H")==0){
				convertedValue="8";
			}else if(strTemp.compare("I")==0){
				convertedValue="9";
			}else if(strTemp.compare("e")==0){
				sign=-1;
				convertedValue="0";
			}else if(strTemp.compare("}")==0){
				sign=-1;
				convertedValue="0";
			}else if(strTemp.compare("J")==0){
				sign=-1;
				convertedValue="1";
			}else if(strTemp.compare("K")==0){
				convertedValue="2";
				sign=-1;
			}else if(strTemp.compare("L")==0){
				convertedValue="3";
				sign=-1;
			}else if(strTemp.compare("M")==0){
				convertedValue="4";
				sign=-1;
			}else if(strTemp.compare("N")==0){
				convertedValue="5";
				sign=-1;
			}else if(strTemp.compare("O")==0){
				convertedValue="6";
				sign=-1;
			}else if(strTemp.compare("P")==0){
				convertedValue="7";
				sign=-1;
			}else if(strTemp.compare("Q")==0){
				convertedValue="8";
				sign=-1;
			}else if(strTemp.compare("R")==0){
				convertedValue="9";
				sign=-1;
			}
			newValue=newValue.replace(i,1,convertedValue);
		}
	}		
	intTemp=atoi(newValue.c_str());
	
	buffer.str("");
 
	if(sign>0){			
		if(intTemp<0){
			intTemp=intTemp*-1;			
		}
	}else if(sign<0){
		if(intTemp>0){
			intTemp=intTemp*-1;	
		}
	}
	
	buffer<<intTemp;
	newValue=buffer.str();
 
	*templength=newValue.length();		
	for(unsigned int i=0;i<newValue.length();i++){		
		temparea[i]=newValue[i];
	}
	
	ccbdata->zccbrc=0;		
	return(0);
}
 
#ifdef __cplusplus
}
#endif
Answered By: Infinity08
Expert Since: 07/08/2003
Accepted Solutions: 3105
Computer Expertise: Advanced
Infinity08 has been an Expert for 5 years 6 months, during which he has posted 17531 comments and answered 3105 questions. Infinity08 is just one of 580 experts in the C Programming Language Zone. 1 expert collaborated on this answer, which was graded an "A" by the asker.
 
 
20081119-EE-VQP-47 - Hierarchy / EE_QW_2_20070628