NO

Author Topic: Pelles C does not work  (Read 4829 times)

Jeliel

  • Guest
Pelles C does not work
« on: December 15, 2007, 06:39:15 PM »
Hi!

I have just started to work with pelles c but it does not work. After typing a programm like "Hello World" it is not possible to compile the programm and run it as console application. Can somebody help me? Does somebody knows where I could find an instruction manuel about pelles c in the web?

Greetings

Judith

Offline Christian

  • Administrator
  • Member
  • *****
  • Posts: 142
    • http://www.pellesc.de
Re: Pelles C does not work
« Reply #1 on: December 15, 2007, 07:11:19 PM »
Could you please tell us the error a little bit more precise?

Do you have any error messages?

Or, is it possible, that the program only appears for the part of a secound, because Windows closes the command window after running a console program?
www.pellesc.de - German PellesC mirror (now available in german and english)

Jeliel

  • Guest
Re: Pelles C does not work
« Reply #2 on: December 15, 2007, 10:28:06 PM »
Hi!

That is right, the console window only opens for a few seconds and than close before showing the programm. I don't have any error messenges. Do you know, what I should do against the window closing?

Greetings

Judith

Offline Robert

  • Member
  • *
  • Posts: 245
Re: Pelles C does not work
« Reply #3 on: December 16, 2007, 12:41:20 AM »
Put

getch();

at the end of your code  For example

#include <stdio.h>
#include <conio.h>
#include <string.h>

main()
{
  char ch[12];
  strcpy( ch, "Hello Judith" );
  printf( "Your string is: %s", ch );
  getch();
}

Robert Wishlaw

Jeliel

  • Guest
Re: Pelles C does not work
« Reply #4 on: December 16, 2007, 10:35:27 AM »
Dear Robert!

Allthough I used your code, with getch() at the end, the project does not work. I typed the code an then compiled it, but nothing happend. Even if I go on the assmeble button (I hope this is the right word), the programm does not work.

Judith

Offline Christian

  • Administrator
  • Member
  • *****
  • Posts: 142
    • http://www.pellesc.de
Re: Pelles C does not work
« Reply #5 on: December 16, 2007, 06:47:58 PM »
Hello,

just try to compile the program, and then open the program from a cmd-screen. (Start->Execute->cmd.exe, then search for the path with cd c:\path\to\the\file...\, then helloworldorwhatelse.exe)

Do you see your hello world?
www.pellesc.de - German PellesC mirror (now available in german and english)

Ngan Lo

  • Guest
Re: Pelles C does not work
« Reply #6 on: December 18, 2007, 03:04:57 PM »
try add the following code at the end ( replace getch() ) :

system("pause");

this will pause the console screen & wait for you to press a key

severach

  • Guest
Re: Pelles C does not work
« Reply #7 on: December 22, 2007, 12:21:11 AM »
Pause and getch() are unnecessary with Pelles because it does stop at the end of execution.

Pelles-C does not compile directly from sources. You must create a project.

File New Project Empty Projects: Win32 Console Program
File New Project Win32 Application.

Offline Robert

  • Member
  • *
  • Posts: 245
Re: Pelles C does not work
« Reply #8 on: December 23, 2007, 06:38:54 AM »

Pause and getch() are unnecessary with Pelles because it does stop at the end of execution.


If you are running the executable from a file manager, for example Windows Explorer, the command line window of the console program vanishes at the end of the program unless pause or getch() are used. If your program is very short, all you will see, maybe, is a blip.

Robert Wishlaw