The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pro*c compilation error satvd Shell Programming and Scripting 1 05-21-2008 07:47 AM
Error unary operator error innocent Shell Programming and Scripting 2 01-30-2008 05:29 PM
binary operator expected error apps_user Shell Programming and Scripting 7 05-11-2007 08:33 PM
Regarding compilation error. sweta High Level Programming 1 12-10-2006 11:30 AM
compilation error in gcc ls1429 High Level Programming 9 06-21-2006 12:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-09-2008
luop0812 luop0812 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 4
xlC compilation error when dealing with operator overloading

Hi,

I have a piece of C++ code that can be compiled using g++, but reports an error when compiled with xlC:

xlC -DHAVE_CONFIG_H -I../SRC -I../include -DNoChange -DSPRNG_MPI -q64 -DLONG64=long -I/usr/lpp/ppe.poe/include -DLONG64=long -c -o libsprng_a-bignum.o bignum.cpp
"bignum.cpp", line 1280.8: 1540-0040 (S) The text "&" is unexpected. "ostream" may be undeclared or ambiguous.



The code segment is as below:

ostream& operator << (ostream& os, const BigNum& bn)
{
unsigned long int * ptr;
unsigned long int i = 1;

if (!bn.v)
return os;

ptr = bn.v + bn.Size() - 1;

os.setf(ios::uppercase);
os << hex << *ptr--;

while (i < bn.size) {
i++;

if (NUMBITS == 32)
os << setw(8) << setfill('0') << hex << *ptr--;
else
os << setw(16) << setfill('0') << hex << *ptr--;
}

os << endl;
// ptr = 0;

return os;
}
  #2 (permalink)  
Old 04-09-2008
luop0812 luop0812 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 4
Solved

The problem has been solved

it would have been nice to tell us how you have solved it in exchange for our willingness to solve it for you if you would not have been able to do it yourself.

Last edited by bakunin; 04-10-2008 at 05:48 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0