Solved

Porting C++ from g++ to xlC

Posted on 2002-03-28
10
302 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Grammars for C C++ and java 1 122
How to split this in C++ 4 101
Eclipse IDE - Cannot copy/paste from console output 8 183
Error C2678: binary '!=': no operator found... 4 47
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…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

813 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