Solved

Porting C++ from g++ to xlC

Posted on 2002-03-28
10
285 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

706 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

19 Experts available now in Live!

Get 1:1 Help Now