| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Oct 16, 2009
Posts: 18
![]() |
Hello, I am learning C++ and am using Xcode as my IDE. This may sound like a dumb question but are there different types of C++? I have been trying to compile some basic source code from planet-source-code.com (calculators and things like that). Some of them work without a problem but the majority have several errors and will not build. I'm not sure if this makes a difference but under compatibility they all say general C++ (which I assumed is what I would want). Could someone please explain to me why this is happening?
|
| QUOTE Thanks | |
![]() Member Since: Jun 02, 2008
Location: Louisville
Posts: 1,502
![]() ![]() Mac Specs: MacBook 2.1GHz Core 2 Duo | 1GB RAM | OS X 10.6.3 | 250GB External HD | 8GB iPod Touch 1st Gen 3.1.3
|
|
| QUOTE Thanks | |
![]() Member Since: Jun 02, 2008
Location: Louisville
Posts: 1,502
![]() ![]() Mac Specs: MacBook 2.1GHz Core 2 Duo | 1GB RAM | OS X 10.6.3 | 250GB External HD | 8GB iPod Touch 1st Gen 3.1.3
|
Quote:
I would suggest picking up a book for learning C++, or going here. I myself will occasionally glance through Sams Teach Yourself C++ book. Aside from that, the main book I use to learn C++ is from Lawrenceville Press, and it's called "A Guide to Programming in C++". It's ISBN is 1-879233-90-8 if you want to pick it up.
|
|
| QUOTE Thanks | ||
![]() Member Since: Oct 16, 2009
Posts: 18
![]() |
|
| QUOTE Thanks | |
![]() Member Since: Jun 02, 2008
Location: Louisville
Posts: 1,502
![]() ![]() Mac Specs: MacBook 2.1GHz Core 2 Duo | 1GB RAM | OS X 10.6.3 | 250GB External HD | 8GB iPod Touch 1st Gen 3.1.3
|
Quote:
I am looking at the source code now. **EDIT** Looked at the errors. You do not have the conio.h directory. conio.h is a MS-DOS header file, so it's not included with OS X. more information
Last edited by cuhnool; 03-17-2010 at 01:19 AM. |
|
| QUOTE Thanks | ||
![]() Member Since: Oct 16, 2009
Posts: 18
![]() |
Ah thank you that makes sense. So I'm assuming I was wrong in thinking that (general) C++ means that it would be universal. Or did that person just put the wrong category?
Oh I see your link now about making conio.h readable in osx. I'm still a bit confused about what the syntax would be though. Would it be #include <conio.h> /usr/lib/libncurses.dylib ? Last edited by O'Brien; 03-17-2010 at 01:28 AM. |
| QUOTE Thanks | |
![]() Member Since: Jun 02, 2008
Location: Louisville
Posts: 1,502
![]() ![]() Mac Specs: MacBook 2.1GHz Core 2 Duo | 1GB RAM | OS X 10.6.3 | 250GB External HD | 8GB iPod Touch 1st Gen 3.1.3
|
Quote:
If there are others, I'm sure there are workarounds or other header files that have identical functions. There shouldn't be too much of a difference.
|
|
| QUOTE Thanks | ||
![]() Member Since: Jun 02, 2008
Location: Louisville
Posts: 1,502
![]() ![]() Mac Specs: MacBook 2.1GHz Core 2 Duo | 1GB RAM | OS X 10.6.3 | 250GB External HD | 8GB iPod Touch 1st Gen 3.1.3
|
Quote:
Nope. I corrected the program, and I have it working. I'll show you in a bit, let me grab some snapshots.
|
|
| QUOTE Thanks | ||
![]() Member Since: Jun 02, 2008
Location: Louisville
Posts: 1,502
![]() ![]() Mac Specs: MacBook 2.1GHz Core 2 Duo | 1GB RAM | OS X 10.6.3 | 250GB External HD | 8GB iPod Touch 1st Gen 3.1.3
|
Go to Project >> Add to Project...
![]() Press Command+Shift+G to bring up the "Go to the folder..." pane. Type in /usr/lib. Click Go ![]() Scroll down until you find the libcurses.dylib file. Click Add ![]() Click Add again ![]() Replace the highlighted line with curses.h ![]() Delete the highlighted line ![]() Delete the highlighted line ![]() Click Build and Go Click the Console button (the arrow is pointing to it) ![]() Go to the Console, and type in an equation using the five operators. The equation I used was 5 ^ 5 which came out to 3,125. I then typed in n to end the program. ![]() -- Hope this helps you out! Should work for you now
|
| QUOTE Thanks | |
![]() Member Since: Oct 16, 2009
Posts: 18
![]() |
Ah thank you so much. I was still getting the error: 'clrscr' was not declared in this scope. I tried removing this function (?) from the code as it did not seem to have a purpose. When I did that it ran fine but when prompted if I wanted to solve another problem I typed "y" and the program exited as if I had typed "n".
edit* Oh now I see the part of your post about deleting the textgreen and clrscr. edit** Never mind I fixed it. Thanks again for all your help! Last edited by O'Brien; 03-17-2010 at 03:35 PM. |
| QUOTE Thanks | |
![]() Member Since: Jun 02, 2008
Location: Louisville
Posts: 1,502
![]() ![]() Mac Specs: MacBook 2.1GHz Core 2 Duo | 1GB RAM | OS X 10.6.3 | 250GB External HD | 8GB iPod Touch 1st Gen 3.1.3
|
Quote:
|
|
| QUOTE Thanks | ||
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| The QUESTION Game | ToddG | Schweb's Lounge | 159 | 08-15-2007 05:25 PM |
| Boot-Up Question Mark Folder Impending Doom Question. | bingwalker | OS X - Operating System | 3 | 07-10-2007 05:19 AM |
| Ask 'me' a question... | eric | Schweb's Lounge | 22 | 01-12-2007 06:33 AM |
| Video production question | macinsandiego | Movies and Video | 4 | 11-17-2004 07:39 AM |
| Postscript question | battleangel444 | OS X - Operating System | 2 | 07-09-2004 12:45 PM |
All times are GMT -4. The time now is 03:51 PM.
Powered by vBulletin