Solved

Porting C++ from g++ to xlC

Posted on 2002-03-28
10
316 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

730 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