Where did the form go? (Newbie) lazarus / 8-Other ---------------------------------------------------------------------- idog · 2009-09-07 10:19 Hi all, I'm a ex-Delphi programmer, moving to Lazarus (on Windows) now that the free Delphi version is no longer available. Everything in Lazarus seems familiar and easy enough so far, but when I Run my program (a very simple form with a menu, no code yet!) using the Run icon or Run->Run, the IDE is minimized - as expected - but I don't see the form anywhere, not even in the system tray. If I open the IDE, the title says "[project name] (debugging...)". When I run the .exe file itself, though, the form appears as expected. It's not a positioning error. The Run->Run File also works as expected. So... how do I make Lazarus run the application by itself after compiling? Thank you very much, Ido ---------------------------------------------------------------------- hy · 2009-09-07 10:25 There are 2 possible probs: 1.) patience - here it takes about 30 seconds from within the ide until the main form appears ... 2.) some of my forms require an additional BringToFront otherwise they are only accessible with an additional taskswitch )-: ---------------------------------------------------------------------- idog · 2009-09-07 10:34 Thanks, but that's not it. I waited for minutes... and it's not a form visibility issue - it's the main form, Visible=True, position=poDesigned with sensible values etc. It doesn't even appear in the task list - it's like the IDE compiles it and minimizes, but doesn't actually run it. ---------------------------------------------------------------------- Martin_fr · 2009-09-07 11:33 Which version of lazarus? First check what your debugger settings are (environment menu / options). If they are set to "none", you should have no problem, but you would be unable to debug. It should be set to GDB, and a path to your gdb exe. Try to find out which version of GDB you have? Make sure your firewall/ anti-virus is not blocking. Anti virus may do so, because the debugger is accessing the internals of an other exe, Which is a behaviour that is also typical for malware. Make sure you compiled with debug info, (project / compile options / linking) -g or -gl; you can alternatively try -gw. Do not "strip" the exe, if you want to debug it. GDB under Windows has some bugs of it's own, depending on the version of GDB this may be more or less severe. The first think you can try is to call "reset debugger" before you execute your programm (each time). You can monitor the debugging process (lot's of info) in Menu/View/Debug-windows/Debug-output. If all that does not help, you may want to try a newer version of GDB, but it should not be necessary. ---------------------------------------------------------------------- idog · 2009-09-07 12:09 Thanks Martin, I'm using version 0.9.26.2 Beta, FPC 2.2.2. Indeed. when I set the debugger to "None" it works as expected. However, in future programs I'd like to be able to debug... I can't find information about the GDB version. I guess it was installed automatically by the Lazarus installation. As far as I can tell, the Antivirus didn't block the debugger's access. I didn't strip the exe, I tried -g/-gl/-WG combinations, didn't help. Reset Debugger didn't work either. The Debug Output shows some weird stuff, so I'm quoting parts of it here: ------------------------------------ &"info program\n" ~"\tUsing the running image of child thread 4860.0x1300.\n" ~"Program stopped at 0x0.\n" ~"Type \"info stack\" or \"info registers\" for more information.\n" ^done (gdb) <-exec-continue> ^running (gdb) &"Warning:\n" &"Cannot insert breakpoint 1.\n" &"Error accessing memory address 0x0: Input/output error.\n" &"\n" ^error,msg="Warning:\nCannot insert breakpoint 1.\nError accessing memory address 0x0: Input/output error.\n" (gdb) ------------------------------------ <-break-insert -t main> &"Function \"main\" not defined in loaded symbols.\n" ^error,msg="Function \"main\" not defined in loaded symbols." (gdb) <-break-insert FPC_RAISEEXCEPTION> &"Function \"FPC_RAISEEXCEPTION\" not defined in loaded symbols.\n" ^error,msg="Function \"FPC_RAISEEXCEPTION\" not defined in loaded symbols." (gdb) <-break-insert FPC_BREAK_ERROR> &"Function \"FPC_BREAK_ERROR\" not defined in loaded symbols.\n" ^error,msg="Function \"FPC_BREAK_ERROR\" not defined in loaded symbols." (gdb) <-break-insert FPC_RUNERROR> &"Function \"FPC_RUNERROR\" not defined in loaded symbols.\n" ^error,msg="Function \"FPC_RUNERROR\" not defined in loaded symbols." (gdb) ---------------------------------------------------------------------- Martin_fr · 2009-09-07 12:34 It looks like it is not finding the symbols (the map at which address, which function is). 1) You do *not* use an external symbol file?  (compiler option/linking -Xg) 2) You did *not* modify your fpc.cfg ? (it's installed by lazarus) 3) You do not use a "launcher application"? (Menu: Run/Run Params/ "use launcher app" ? 4) Same dialog as in 3: you do not have a "host application" set? In the debug output you should find a line <-file-exec-and-symbols "C:\path\to\your\exe\projectname.exe"> Also double check your executable on the hard-disk, it should have at least 10 to 15 MB (just for a simple form). I know this is huge, but it's all the debug info. For distribution, you compile it without debug info, and it will be smaller. If it is none of those, try to catch the attention of some-one more familiar with the debugger (eg change the subject to: "my app doesn't run in debugger") ---------------------------------------------------------------------- idog · 2009-09-07 12:45 I didn't touch any of these, but in case I changed some other setting I shouldn't have, I just reinatalled the entire thing. Now it alll works like charm :-) Thanks again for the help. ---------------------------------------------------------------------- idog · 2009-09-07 13:32 It turns out I selected "Use external gdb debug symbols file" in the compiler options, and this caused the form to disappear - even though I removed this selection later, the problem remained. To restore things, I deleted the .gdb file from the program directory.