•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,439 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,613 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 13875 | Replies: 15
![]() |
>Again if anyone knows why I'm getting the compile error posted above when
>using g++ in linux (ubuntu) would you please help me out?
I had nothing better to do, so I decided to screw around with the code Narue posted. You're correct in that g++ gives an error when compiling the 'pause' class. Try renaming the entire 'pause' class to something else, perhaps pause2 (in other words, do an entire find and replace with 'pause'), and it'll compile fine. I asked Narue about this on IRC, and she figured it was probably some gcc/g++ extension that was messing things up (which is obviously the only real possibility here).
>using g++ in linux (ubuntu) would you please help me out?
I had nothing better to do, so I decided to screw around with the code Narue posted. You're correct in that g++ gives an error when compiling the 'pause' class. Try renaming the entire 'pause' class to something else, perhaps pause2 (in other words, do an entire find and replace with 'pause'), and it'll compile fine. I asked Narue about this on IRC, and she figured it was probably some gcc/g++ extension that was messing things up (which is obviously the only real possibility here).
Last edited by John A : May 26th, 2008 at 7:52 pm.
tuxation.com - Linux articles, tutorials, and discussions
•
•
Join Date: Mar 2008
Posts: 22
Reputation:
Rep Power: 1
Solved Threads: 0
Thank you John A and Narue.
I never would have thought of something like that since I'm a noob. I don't know enough to decide between windows, linux and the different compilers who is complying with c++ standards and who is not fully compliant. You are a real help.
Thanks for the hard work coding this and thanks for looking into my g++ problem.
I never would have thought of something like that since I'm a noob. I don't know enough to decide between windows, linux and the different compilers who is complying with c++ standards and who is not fully compliant. You are a real help.
Thanks for the hard work coding this and thanks for looking into my g++ problem.
•
•
Join Date: Dec 2006
Location: india
Posts: 1,085
Reputation:
Rep Power: 9
Solved Threads: 163
> ...probably some gcc/g++ extension that was messing things up
> (which is obviously the only real possibility here).
it is not some gcc/g++ extension; it is POSIX
> (which is obviously the only real possibility here).
it is not some gcc/g++ extension; it is POSIX
man pause http://node1.yo-linux.com/cgi-bin/ma...ommand=pause(2) Last edited by vijayan121 : May 27th, 2008 at 2:39 am.
That's why Edward puts as much code as possible in namespaces. Compilers are bad about including all kinds of unexpected stuff in the standard headers, so even if you don't include unistd.h yourself, iostream or another standard header might do it for you and create a name conflict.
If at first you don't succeed, keep on sucking until you do succeed.
•
•
Join Date: Mar 2008
Posts: 22
Reputation:
Rep Power: 1
Solved Threads: 0
I can not find unistd.h anywhere on my system.
So let me see if I understand this.
POSIX is the linux API just like there's a Windows API.
By changing pause to pause2, we have something that complies to c++ standards, Windows API standards, and POSIX standards.
Is that how it works? I guess just learning c++ will not be enough if I want to program cross platform?
Is one or the other of the above mentioned not 100% following standards or is that just the way it works?
Sorry so many questions but I don't understand this type of issue yet. Tell me if I'm way off in my way of thinking. Is this even a standards issue or something else?
Thanks
So let me see if I understand this.
POSIX is the linux API just like there's a Windows API.
By changing pause to pause2, we have something that complies to c++ standards, Windows API standards, and POSIX standards.
Is that how it works? I guess just learning c++ will not be enough if I want to program cross platform?
Is one or the other of the above mentioned not 100% following standards or is that just the way it works?
Sorry so many questions but I don't understand this type of issue yet. Tell me if I'm way off in my way of thinking. Is this even a standards issue or something else?
Thanks
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- convert lower case letters to uppercase and vice-versa (C++)
- overloaded input stream help (C++)
- Noob : Input Stream Trouble (Java)
- string input not working as expected (C++)
- Print_Zero Function (C)
- Question:: reading from an input stream. (C++)
- Do/While Loop help (C++)
- How do I pause a Prorgam? (C++)
Other Threads in the C++ Forum
- Previous Thread: Win32 DialogBox
- Next Thread: icon in win32 program



Linear Mode