Recent

Author Topic: Why do i get this error?  (Read 5365 times)

captian jaster

  • Guest
Why do i get this error?
« on: February 25, 2010, 07:29:27 pm »
Code: [Select]
PROGRAM base;

 USES gtk;

 { -------------------------------Global Variable---------------------------- }
 VAR
window : pGtkWidget;

 { ---------------------------------Main Program------------------------------ }
 BEGIN
gtk_init(@argc, @argv); { Initialise GTK }
window := gtk_window_new(GTK_WINDOW_TOPLEVEL); { Create a new window }
gtk_widget_show(window);
gtk_main();
 END. { ----------------------------------Main Program------------------------------ }
 
i got the code from freepascal.org.
when i try to compile it says unit expected but program found..
Help

Wodzu

  • Full Member
  • ***
  • Posts: 171
Re: Why do i get this error?
« Reply #1 on: February 25, 2010, 08:24:05 pm »
That means that your pascal file miss a keyword unit with a name.

Code: [Select]
unit MyProgram;

PROGRAM Base;

.......

zakwas

  • New Member
  • *
  • Posts: 10
Re: Why do i get this error?
« Reply #2 on: February 25, 2010, 10:01:47 pm »
Menu:
New...-New console application

Erase all new code and paste your sample code.

Bart

  • Hero Member
  • *****
  • Posts: 5706
    • Bart en Mariska's Webstek
Re: Why do i get this error?
« Reply #3 on: February 26, 2010, 01:05:55 am »
Excuse me for saying this, but this seems a litle bit out of your league.

Bart

 

TinyPortal © 2005-2018