Solved

Porting C++ from g++ to xlC

Posted on 2002-03-28
10
296 Views
Last Modified: 2008-03-17

I have some C++ code I am trying to move from a g++ compiler to xlC so I can use UDB.  However, I am getting stuck on a few items:

Here are things the compiler doesn't recognize.

- bool/true/false
- va_start, va_end
- runtime_error
- string
- isprint

Also, the code uses pthreads.  I can't get it to compile to check that out.  Any concerns there?

What flags can I set or at least workarounds can I use?

Are there any good web sites to explain this?  The IBM site sends me around in circles.

Thanks,
AMD_MAN
0
Comment
Question by:AMD_MAN
  • 4
  • 4
  • 2
10 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 6903480
Is xlC a C++ compiler, or a C only compiler?

What is your target platform?
0
 

Author Comment

by:AMD_MAN
ID: 6903511

AIX is the target platform.  We are going from Linux/g++ to AIX/xlC.  xlC is the "C Set ++ for AIX Compiler", in other words, IBM's C++ compiler.

I have things down to where it seems to not like the "bool"

The other problems were solved so far by including the right .h files.  I have no idea why that worked under g++ without them.

But open questions beyond the "bool" problem remain.

I need to make sure my pthreads work, etc.

Thanks,
AMD_MAN
0
 
LVL 30

Expert Comment

by:Axter
ID: 6903555
>>The other problems were solved so far by including the
>>right .h files.

g++ and most compilers support the NON-Standard *.h files.

You should not use these files becaues they are not portable, and they're different from one compiler to the next.

If you're compiler is not seeing the extension-less C++ standard files, then you're problem not including a required switch when compiling.

Check the docs on your compiler.
There should be something in there about using a command line switch to get your code to compile under the new standards.
This problem is also related to the bool problem.
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7036243
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0
 
LVL 30

Expert Comment

by:Axter
ID: 7038294
Posting previous comment as answer.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:AMD_MAN
ID: 7039061
Flags weren't the problem here.

It seems that the CSet++ compilers support an older standard (1992) than the newer Visual aga compilers.  References to bool and vector, etc had to be removed and replaced with other code.

I have modified the code and it now works...
0
 
LVL 30

Expert Comment

by:Axter
ID: 7039070
Can you please delete this question.
0
 

Author Comment

by:AMD_MAN
ID: 7039074

Mindphaser,

I propose we close this question with your third recommendation (quoted below).  I didn't get the answer, but after realizing the solution on my own, I noted it here.

3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may
help others.
0
 

Author Comment

by:AMD_MAN
ID: 7039190

Axter asked me to delete this question.  He didn't have the correct solution and my solution didn't go into the proper detail.  Also, it involves such and old compiler that no one probably uses it anymore.

0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 7039502
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question of running the program built from sample in codeproject website 3 61
Unable to start eclipse ? 17 132
max float value 3 26
Copy output image from TWindowsMediaPlayer 6 23
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now