I'm starting to learn C++, and I'm using Code::Blocks to do so. However, once I choose "build", nothing happens when I run the program! Is it something wrong with the default GNU GCC Compiler, or is it that I'm using a mac? I really need help here!
Mods: Feel free to move this if it's in the wrong spot.
Last edited by WingsGames (2012-01-02 17:26:56)
Offline
Download Xcode from developer.apple.com. You'll have to get free account, and the download is rather big, but if you are serious about development on a mac, XCode is the way to go. (and I can help you)
Offline
In the App Store, download Xcode. It's also got a compiler for C, Objective-C, and C++. Go to Create New Project With Xcode > Mac OS X > Application > Command Line Tool and then fill out the stuff. I don't think that Automatic Reference Counting really does anything in C++. Code::Blocks needs a compiler, and if you got it with the compiler, it would generate EXE files. If you like Code::Blocks more than Xcode, then I think that there's some command line command that you can use to compile it or the Build button might work too.
You don't need to go to developer.apple.com unless you're using Snow Leopard (it has a version for that, instead of the newest one which is for Lion).
Last edited by maxskywalker (2012-01-02 18:02:06)
Offline
use dev-c++ instead. I did after I tried code blocks. Or you could make sure that the compiler is in your system PATH variable.
Offline
Why do you shun away from GNU stuff. It's the best out there G++/GCC/Gnu Compiler is the best.
Offline
You have to set up codeblocks correctly for it to work.
I think Xcode is the best for Mac. Btw, Isn't Dev C++ only for windows?
(On a side note, This is the first C++ question I have seen here, everyone else seems to be programming in everything except C++!)
Last edited by adityasm9 (2012-01-02 22:19:35)
Offline
no C++ is usefull it is harder than most other lenguages, but it seems to make better quality games, Although since C++ is cool in my opinion, I prefer using Scratch, Adobe Flash , and XHTML to make games on the internet (specially XHTML) (fav programing lenguage).
Offline
But I've learnt it! I my opinion its not hard at all. I mean I've done all the basics and even OOP. trouble is, I don't know what to do next...How do I for instance, build a cross platform or windows app? or how do i use it on the web? You see all these people
making cool thing that interface scratch with various other systems (like android for instance)and I've always wondered...how would I do that?
Offline
Alright, this getting a bit off topic. It is a C++ help discussion, rather then a Python versus C++ discussion. I'll try my best at answering adityasm9's questions.
Cross-platform: Use a program like the following.
#ifdef WINDOWS
windowsCode();
#elif MAC
macCode();
#elif LINUX
linuxCode();
#else
printf("Unsupported operating system.");
#endifWindows app. Look at the Microsoft Developer site at msdn.microsoft.com
Web app. Google has done some work in this area, and you may want to take a look at Google Native Client SDK at https://developers.google.com/native-client/.
Interfacing with Scratch. You may want to research socket programming, and a good tutorial can be found at http://www.linuxhowtos.org/C_C++/socket.htm You may also want to look at my own FireMMO at http://scratch.mit.edu/forums/viewtopic.php?id=68218
I hope some of this is a help to anyone.
-bobbybee (Experienced C++ programmer for (insert large number) years)
Offline
Offline
Have you looked at any of these options yet?
Offline
bobbybee wrote:
Have you looked at any of these options yet?
I got Xcode, but it can't find iostream.
Offline
Are you sure that all of the libraries are installed correctly. When you installed Xcode, did you do the standard install? If you didn't, do you remember what you installed?
Also, just to make sure XCode is working, try compiling either the C example, or one of the mac application examples.
Offline