Recent

Author Topic: a begginer's question...  (Read 7905 times)

someone2011

  • Newbie
  • Posts: 4
a begginer's question...
« on: January 23, 2011, 04:48:24 pm »
i started learning programming with pascal a few months ago. i switched to linux a few days ago and installed lazarus(also newbe here). so i tried to make a simple 'hello' (custom) program everything seems to work fine but i dont see anywhere the output
some help...?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: a begginer's question...
« Reply #1 on: January 23, 2011, 04:54:14 pm »
Have you tried the Lib folder?
« Last Edit: January 23, 2011, 05:00:31 pm by typo »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8273
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: a begginer's question...
« Reply #2 on: January 23, 2011, 05:15:23 pm »
Quote
i dont see anywhere the output
Put ReadLn just before the end.

someone2011

  • Newbie
  • Posts: 4
Re: a begginer's question...
« Reply #3 on: January 23, 2011, 05:18:07 pm »
Have you tried the Lib folder?

as i said im new to all these
what do you mean exacly?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: a begginer's question...
« Reply #4 on: January 23, 2011, 05:20:11 pm »
I thought you could not find the executable file.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6675
  • Debugger - SynEdit - and more
    • wiki
Re: a begginer's question...
« Reply #5 on: January 23, 2011, 05:25:26 pm »
Have you tried running your executable, outside the IDE? Just open a terminal, and run your app there?

What version of Lazarus?
You may have to configure the debugger in Lazarus, you may have to add a starter app (under "run param" from run menu), but starte app + debugger => dos not work well...

Debugging console app is not fully integrated... (but possible...). Hence which version of Laz?

someone2011

  • Newbie
  • Posts: 4
Re: a begginer's question...
« Reply #6 on: January 23, 2011, 05:44:13 pm »
Have you tried running your executable, outside the IDE? Just open a terminal, and run your app there?

What version of Lazarus?
You may have to configure the debugger in Lazarus, you may have to add a starter app (under "run param" from run menu), but starte app + debugger => dos not work well...

Debugging console app is not fully integrated... (but possible...). Hence which version of Laz?

the version is Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 x86_64-linux-gtk 2 (beta)
if you need any other information let me know

someone2011

  • Newbie
  • Posts: 4
Re: a begginer's question...
« Reply #7 on: January 23, 2011, 05:47:09 pm »
... i installed through the ubuntu software center

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6675
  • Debugger - SynEdit - and more
    • wiki
Re: a begginer's question...
« Reply #8 on: January 23, 2011, 07:18:36 pm »
Have you tried to start your app from a terminal, outside the IDE?

I assume:
- your app does compile?
- you get a executable file, on your harddisk (.e.g. project1)

1)
So in a terminal (xterm, gnome-terminal, ...) you can start it?

2)
In Lazarus you can go to the "run" menu, and in "Run Param" you can define a starter app (e.g xterm).
However starter app only works if you choose no debugger (Environment options).


3)
If you want to debug your app in Lazarus, you need the latest snapshot (0.9.31).
And it is a little tricky, as debugging console apps (writeln, readeln) is not fully integrated yet.
http://bugs.freepascal.org/view.php?id=12172
Configure gdb in the environment options.

Then you need to first start a terminal, then in that terminal run "tty", which will give you something like "/dev/pty/1" or /dev/ttyN" or ...)
This you just enter in the debug config as the "ConsoleTTy" in "debugger => general" ("debugger specific options")

When you start your app, it's in/output will be on this extra terminal.

------------
It's easier under windows, because windows hives you a separate terminal window anyway...

The problem only exists for console apps. GUI apps are easier to debug.

 

TinyPortal © 2005-2018