Solved

Porting C++ from g++ to xlC

Posted on 2002-03-28
10
312 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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 how to clear a vector as well as how to detect empty vectors in C++.

839 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