This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-01-02 17:24:12

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

C++ Help Needed

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)


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#2 2012-01-02 17:26:42

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: C++ Help Needed

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)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-01-02 18:01:19

maxskywalker
Scratcher
Registered: 2008-01-27
Posts: 1000+

Re: C++ Help Needed

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

 

#4 2012-01-02 18:05:46

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: C++ Help Needed

Do you have a C++ compiler? I'd get MinGW if you don't.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#5 2012-01-02 18:31:58

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: C++ Help Needed

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

 

#6 2012-01-02 19:36:06

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: C++ Help Needed

Why do you shun away from GNU stuff. It's the best out there G++/GCC/Gnu Compiler is the best.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#7 2012-01-02 22:07:09

adityasm9
Scratcher
Registered: 2008-03-12
Posts: 100+

Re: C++ Help Needed

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

 

#8 2012-01-03 02:06:47

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: C++ Help Needed

because c/c++ is an evil language
jk

Offline

 

#9 2012-01-03 02:11:49

arch20045
New Scratcher
Registered: 2011-11-24
Posts: 7

Re: C++ Help Needed

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

 

#10 2012-01-03 02:27:11

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: C++ Help Needed

c++ is fast, but is hard to learn and takes more time to develop

python is slower, but you can learn it and it doesn't take much time to write code

Offline

 

#11 2012-01-03 02:46:19

adityasm9
Scratcher
Registered: 2008-03-12
Posts: 100+

Re: C++ Help Needed

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

 

#12 2012-01-03 18:32:37

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: C++ Help Needed

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.

Code:

#ifdef WINDOWS
windowsCode();
#elif MAC
macCode();
#elif LINUX
linuxCode();
#else
printf("Unsupported operating system.");
#endif

Windows 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)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#13 2012-01-03 21:41:03

adityasm9
Scratcher
Registered: 2008-03-12
Posts: 100+

Re: C++ Help Needed

Alright. Thanks, no more off topic stuff.  smile

Offline

 

#14 2012-01-04 16:16:08

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: C++ Help Needed

Have you looked at any of these options yet?


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#15 2012-01-06 12:50:01

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: C++ Help Needed

bobbybee wrote:

Have you looked at any of these options yet?

I got Xcode, but it can't find iostream.


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#16 2012-01-06 17:21:31

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: C++ Help Needed

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.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

Board footer