Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

How could this "hello world" be wrong?

hello world

  • Please log in to reply
5 replies to this topic

#1 spadez


    CC Regular

  • Just Joined
  • PipPipPip
  • 38 posts

Posted 02 February 2009 - 02:54 PM

I dont understand, im starting out learning C, ive just installed visual studio and im following a hello world tutorial:

Im creating a win32 console application and my code is:

/* Author: Your name
   Date: yyyy/mm/dd
   Writes the words "Hello World" on the screen */
#include "stdafx.h"
int main()
   printf("Hello World\n"); //prints "Hello World"
   return 0;

Yet when I try to compile it says:

"Error spawning rc.exe"
  • 0

#2 Guest_Jordan_*

  • Guest

Posted 02 February 2009 - 03:46 PM

Does the rc.exe file exist? The most common problem I see from this error is that executable isn't available.
  • 0

#3 shadowhound


    CC Regular

  • Just Joined
  • PipPipPip
  • 30 posts

Posted 02 February 2009 - 03:50 PM

okay visual C++ is a hard compiler to use and i thort i would start to learn C untill i was told to learn C++ since its better and more powerfull im using Dev C++ if i was you what i would do is download Dev C++ and start a new project *console app* and write the hello world like this

#include <iostream>
using namespace std;

int main()
      cout <<"Hello World" << endl; // this displays Hello world
      system("PAUSE"); // got to add this to make console stay up in Dev C++
      return 0;

  • 0

#4 Tparker


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 04 February 2009 - 09:07 PM

I will use a GNU C compiler rather than windows visual C++ but of course it depends what application you are going to develop and what platform
  • 0

#5 fread


    Programming God

  • Senior Member
  • PipPipPipPipPipPip
  • 897 posts
  • Location:Trinidad and Tobago
  • Learning:C, Java, C++, C#, PHP, Python, PL/SQL

Posted 05 February 2009 - 02:52 AM

Or u can download the tiny c compiler (tcc) which does not have a gui but would compile any standard c program. If you like the idea of working with an ide you should probably go with shadowhound's idea and get dev c++ which is a c and c++ compiler. This compiler is easy to set up and fairly easy to use, especially for beginners like you and I.
  • 0

#6 PythonPower


    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 179 posts

Posted 05 February 2009 - 08:28 AM

The GNU C Compiler's rise to fame is partly based on its standards compatibility. You can get it on Windows too if you want - it's not too hard if I remember.

There are two methods:

MinGW | Minimalist GNU for Windows

They are quite different, if I remember correctly, but they should both achieve what you need.
  • 0

Also tagged with one or more of these keywords: hello world

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download