Running After Compiling lazarus / 9-Editor ---------------------------------------------------------------------- Ashmere · 2009-08-29 21:11 Hi, Im having trouble and I hope ive put this topic in the right place, Ive just started learning Delphi and Im trying to compile a coulpe of really simple programs but when i compile them it gives me 16 files aswell as a backup folder, which is not a problem but when i try running the .exe (Im using widows xp) absolutely nothing happens. It is very fustrating. If anyone could help that would be great! ---------------------------------------------------------------------- Yurgel · 2009-08-29 22:03 hard to say something without sources. maybe you program really does nothing? can you copy-paste your code here? ---------------------------------------------------------------------- Martin_fr · 2009-08-29 22:12 Well you need to give a bit more info: Which version of Lazarus? and FPC? (see help menu / about dialog) Do you try to run the exe within lazarus or from windows directly? If you run within lazarus check your debugger settings (environment menu => options => Tree: Debugger). It should be "gnu debugger (gdb)" and point to an executable of gdb.exe. What do you expect to happen? That is did you write a GUI app with Forms? or a console app using readln/writeln etc? For console app there is a switch in the linking tab of the compiler options, so you get the dos window in which to run. You also must make sure it does not close faster than you can see it. For GUI apps, does a simple form, with absolutely *no* additional code work? ---------------------------------------------------------------------- Ashmere · 2009-08-29 22:21 As this is my very first time using this program, half of what you just said makes absolutely no sence to me, the Lazarus version im using is 0.9.26.2 beta and theFPC is 2.2.2 Code: [Select]unit unit2; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,   StdCtrls; type   { TForm1 }   TForm1 = class(TForm)     Button1: TButton;     Label1: TLabel;     procedure Button1Click(Sender: TObject);     procedure Label1Click(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   Form1: TForm1; implementation { TForm1 } procedure TForm1.Label1Click(Sender: TObject); begin end; procedure TForm1.Button1Click(Sender: TObject); begin   Label1.Caption := 'Hello World, Part II'; end; initialization   {$I unit2.lrs} end. im trying to run it directly in windows as i press the Green arrow (RUN?) and it puts all the files in the folder that ive saved the project in, and so then i try running the .exe and nothing happens, its just a little form with a button and when the button is pressed the text says "hello world". thats about all i can tell you. ---------------------------------------------------------------------- Ashmere · 2009-08-29 22:33 Also when trying to run it in the Lazarus program it asks me for unit2.lrs, whats up with this file? ---------------------------------------------------------------------- Martin_fr · 2009-08-29 22:51 While not necessarily wrong, I wonder why it is "unit2". A single form app would normally have a "unit1". Maybe you did have one form, added another (or copied it), and removed the first? In that case the 2nd form isn't automatically shown. Please check in the project menu => project options => tab: "Forms". Your form must be in the list of "auto-create forms". If no form is auto created that would explain why the app terminates immediately. Also when trying to run it in the Lazarus program it asks me for unit2.lrs, whats up with this file? unit2.lrs is the "resource" for tour form, it contains all the settings you mad in the Object-Inspector. Lazarus should create it automatically (from the unit2.lfm file, which is a text file containing the same settings) So I wonder why Lazarus would ask for it. Can you copy the messages during compilation? (right mouse on message window: "copy all and hidden") Just to be save: View the project source (from the project menu). And check that your unit2 is used, and if any "unit1" is still used (depends on if you want a unit1 to be used) if a unit1 is also used, and exists, make sure it doesn't have a form of the same name ("Form1"). The easier way is to start from scratch and make sure you just save the one unit you need (you can choose any name you wish) ---------------------------------------------------------------------- Yurgel · 2009-08-29 22:56 Quote from: Ashmere on August 30, 2009, 12:33:19 amAlso when trying to run it in the Lazarus program it asks me for unit2.lrs, whats up with this file? simply delete this line (  {$I unit2.lrs} )