Welcome! Log In Create A New Profile

Advanced

Know of any good compilers?

Posted by nintendude 
Know of any good compilers?
April 28, 2009 11:50PM
Does anyone here know of any good free compilers for Mac or PC? I'm reading "Learn C in 21 Days" (as I read that C is a great first language to learn) and I need a compiler to compile, link, and execute my source code! Right now, I'm downloading Xcode for my Mac and I tried to download Visual C++ for Windows (on my Boot Camp XP partition), but it wouldn't download, even after trying to troubleshoot! Anyone have any suggestions?
Re: Know of any good compilers?
April 29, 2009 01:25AM
Try Dev-C++ or Programmer's Notepad.
Re: Know of any good compilers?
April 29, 2009 06:37AM
Where may I obtain these?
Re: Know of any good compilers?
April 29, 2009 11:04AM
You can get Devkit Pro one click away from the wiibrew main page. [www.wiibrew.org]
Read this to know how to set it up! [www.wiibrew.org]
(Programmers Notepad is included in Devkit Pro.)

I just started reading those pages too!
I'm on day three!

How long have you been reading, nintendude?
Do you have programming experience from before you started reading "C++ in 21 days"?

How do I actually compile and link with Programmers Notepad? Do I have to write a makefile and then click make? In that case, how do I know what to write in the makefile?

Sorry for stealing your topic. Just ignore me and I'll make a new topic :D
Re: Know of any good compilers?
April 29, 2009 09:16PM
Quote
profetylen
How do I actually compile and link with Programmers Notepad? Do I have to write a makefile and then click make? In that case, how do I know what to write in the makefile?
Theres an example somewhere in devkitPRO of hello world. Copy the example folder into a projects folder on your main drive (path should be C:/projects/wii/helloworld ). Open the .pnproj file and select make. It should compile clean. After that use the project as a starting point for bigger projects.
Re: Know of any good compilers?
April 29, 2009 09:17PM
Quote
nintendude
Where may I obtain these?
[www.pnotepad.org]
[www.bloodshed.net]
Re: Know of any good compilers?
April 29, 2009 10:39PM
Yes, I have found that example a while ago.

But if I want to make programs that can be run on windows (for the purpose of learning) how do I write and compile such a helloworld program?
Didn't quite understand how to compile from what i read in "C++ in 21 days".

(I'll start making wii homebrew when I'm done learning. Yahoo! :D)

Thanks!
Re: Know of any good compilers?
April 30, 2009 12:51AM
Oh, windows programs are so much easier!

First you need to set up an IDE. I reccomend Dev-C++ (see the link 2 posts above).

After thats done copy and paste this program into Dev-C++:

#include 

    int main() {

       std::cout << "Hello World!";

         int hold = 0;

       std::cin >> hold;

      return 0;

 }

In Dev-C++, click execute, then click compile and run. Save your program with a .cpp extension. A black console window should open up saying Hello World. Press any key and then press ENTER to close the console window.

Edit: For some reason, the first line of the program is cut out by crappy phorum software :S



Edited 2 time(s). Last edit at 05/01/2009 09:32PM by Arikado.
Re: Know of any good compilers?
May 01, 2009 07:06AM
Quote
profetylen
You can get Devkit Pro one click away from the wiibrew main page. [www.wiibrew.org]
Read this to know how to set it up! [www.wiibrew.org]
(Programmers Notepad is included in Devkit Pro.)

I just started reading those pages too!
I'm on day three!

How long have you been reading, nintendude?
Do you have programming experience from before you started reading "C++ in 21 days"?

How do I actually compile and link with Programmers Notepad? Do I have to write a makefile and then click make? In that case, how do I know what to write in the makefile?

Sorry for stealing your topic. Just ignore me and I'll make a new topic :D

Hi! Sorry, I'm not ignoring you, I just was busy with other things yesterday, so I got side-tracked. I managed to get my iPhone 3G jailbroken (in the words of Falco: "Piece of cake!") and I must say that it's AWESOME (not as awesome as playing Brawl+ will be!)!

Anyway, I'm on day one as I was stuck on finding a compiler for both Mac OS X and Windows, but, thanks to Arikado, I now have both and I'll be ready to continue and get through the rest of the book in no time! :)

As for your other question about previous experience, in high school, I learned (at least somewhat) Javascript and very little C++. Now I'm starting from scratch with C because, as the book says, this is a great first language to start with.

Well, if you excuse me, I'm going to go download what Arikado recommended and continue on with "Learn C in 21 Days".
Re: Know of any good compilers?
May 01, 2009 07:54AM
I seem to have a problem trying to compile and run what "Learn C in 21 Days" wants me to type out:

#include

main()
{
printf("Hello, World!\n");
return 0;
}

I tried to compile what you said to copy and paste into Dev C++, but to no avail (probably because the 1st line got cut off). Is there a difference in why Dev C++ won't compile and run what I typed out?
Re: Know of any good compilers?
May 01, 2009 03:35PM
What's the error mesage?
And which compiler and IDE did you pick?
When you compile, you should usually see a list of things that happenend and things that went wrong.

EDIT:
A copy of your code works fine in Visual Studio 2008

(assuming your first line is #include < stdio.h >)



Edited 2 time(s). Last edit at 05/01/2009 03:58PM by daniel_c_w.
Re: Know of any good compilers?
May 01, 2009 09:34PM
Quote
nintendude
I tried to compile what you said to copy and paste into Dev C++, but to no avail (probably because the 1st line got cut off). Is there a difference in why Dev C++ won't compile and run what I typed out?
Quote my post and copy and paste what's inbetween [ code] and [/ code]
Sorry, only registered users may post in this forum.

Click here to login