NO

Author Topic: Please Help error# 2001  (Read 7223 times)

mohnblume92

  • Guest
Please Help error# 2001
« on: August 27, 2009, 08:55:42 PM »
Hello^^
I'm doing a programm for school with selfmade *.h files. I think I got now how to make *.h files and the apertaining *.c's. After I worked a whole sunday on understanding this, I now have two problems; the first is the stranger one.

The Code:
Code: [Select]
/*Erklärung*/

#include <stdio.h>
#include <conio.h>
#include "Mathe.h"
#include "Geom.h"
#include "Menue.h"
//---------------------------------
int main (void) {  //that's line 9
printf ("blah!");


return 0;
}

The error:
Erzeugen von Rechenprogramm4.obj.
C:\Users\Schule\Documents\Pelles C Projects\Rechenprogramm4\Rechenprogramm4.c(9): error #2001: Syntax error: expected '{' but found 'int'.
C:\Users\Schule\Documents\Pelles C Projects\Rechenprogramm4\Rechenprogramm4.c(9): error #2001: Syntax error: expected ';' but found '{'.
*** Fehlercode: 1 ***
Fertig.


And what's wrong? oO because I'm sitting here an hour and I don't get what's wrong. Sometimes Pelles tells me that there is an error #2001 in stdio.h o__O
 :'(How can I solve the problem??

and another question;
how can I execute something from one of the header files in my main file?
« Last Edit: August 27, 2009, 08:57:35 PM by mohnblume92 »

JohnF

  • Guest
Re: Please Help error# 2001
« Reply #1 on: August 27, 2009, 11:08:06 PM »
Hello
I'm doing a programm for school with selfmade *.h files. I think I got now how to make *.h files and the apertaining *.c's. After I worked a whole sunday on understanding this, I now have two problems; the first is the stranger one.

Trying this code I get no problems. Note I've had to comment out those includes.

The Code:
Code: [Select]
/*Erklärung*/

#include <stdio.h>
#include <conio.h>
//#include "Mathe.h"
//#include "Geom.h"
//#include "Menue.h"
//---------------------------------
int main (void) {  //that's line 9

  printf ("blah!");
  return 0;
}

Quote
And what's wrong? oO because I'm sitting here an hour and I don't get what's wrong. Sometimes Pelles tells me that there is an error #2001 in stdio.h o__O
 :'(How can I solve the problem??

Never seen that problem - maybe you have something wrong elsewhere that is causing it.

Quote
and another question;
how can I execute something from one of the header files in my main file?

You can't execute something from a header file.

John
« Last Edit: August 27, 2009, 11:11:57 PM by JohnF »

JohnF

  • Guest
Re: Please Help error# 2001
« Reply #2 on: August 28, 2009, 08:36:38 AM »
Perhaps you should post your headers.

#include "Mathe.h"
#include "Geom.h"
#include "Menue.h"

John


mohnblume92

  • Guest
Re: Please Help error# 2001
« Reply #3 on: August 28, 2009, 10:16:59 AM »
Thank you for help^^ I've found the problem now.
An ";" was missing in my menue header.  >:( Always such silly mistakes....