Recent

Author Topic: run hello world directly from lazarus  (Read 12808 times)

hgraca

  • New member
  • *
  • Posts: 7
run hello world directly from lazarus
« on: October 12, 2009, 10:14:19 am »
Hi,

im trying to run a simple hello world program from lazarus, in linux.
When I push RUN it looks as if it is running, but nothing shows up.
I push the stop button and it says "execution stoped", so it is really executing.

Now, im running it from the command line with "./helloworld", however there should be a way of making lazarus open a box, like when I'm working in windows.

How can I make Lazarus show the output box (command line style) ?

Tkx

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: run hello world directly from lazarus
« Reply #1 on: October 12, 2009, 11:04:35 am »
Things in linux are not as comfortable as in Windows. You can use xterm as launching application (see Run Paramaters), but then it is not possible to debug your application.

hgraca

  • New member
  • *
  • Posts: 7
Re: run hello world directly from lazarus
« Reply #2 on: October 12, 2009, 11:28:38 am »
tkx for your reply.

I went to "run > run parameters" and ticked the checkbox "use launching application", however it gives me the following error:

The launching aplication "/usr/X11R6/bin/xterm -T .... helloworld" does not exist or is not executable

I searched the paths and found that "/usr/X11R6/bin/" does not exist, although "/usr/X11R6/lib/" does exist.

What do I need to do to fix this?

tkx

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1946
Re: run hello world directly from lazarus
« Reply #3 on: October 12, 2009, 11:31:18 am »
For me, it's enough to disable the debugger and add a readln at the end of of the simple program:
Code: [Select]
writeln('test');
readln;   

This shows a console window and closes after pressing the return key
« Last Edit: October 12, 2009, 11:33:23 am by theo »

hgraca

  • New member
  • *
  • Posts: 7
Re: run hello world directly from lazarus
« Reply #4 on: October 12, 2009, 12:45:59 pm »
How do I disable de debugger?

I went to "environment>options>debugger" and selected  "none" in the first option, but it still doesnt work for me, and still gives me the same error message.

I also used synaptics to install X11, but still the same error and the BIN folder still doesnt exist...  :(

any ideas?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1946
Re: run hello world directly from lazarus
« Reply #5 on: October 12, 2009, 02:04:11 pm »
any ideas?

Uncheck "use launching application"

hgraca

  • New member
  • *
  • Posts: 7
Re: run hello world directly from lazarus
« Reply #6 on: October 12, 2009, 06:46:18 pm »
I didnt had xterm installed, i did

apt-get install xterm

Unchecked "use launching application"

disable de debugger in "environment>options>debugger" and selected  "none" in the first option

and it worked

tkx :)

marinero

  • Newbie
  • Posts: 1
Re: run hello world directly from lazarus
« Reply #7 on: October 18, 2009, 04:36:04 pm »
and it's planned to implement console debugging in linux in the future? or it's something that simply can't be done easily
just a question, I'm not demanding anything

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2695
Re: run hello world directly from lazarus
« Reply #8 on: October 19, 2009, 11:27:11 am »
I the far future yes. The problem with the current GDB implementation is that it mixes console output with gdb output. So for the gdb parser is is almost impossible to know what should be parsed and what not.
I've already been looking at a patch which can work around this, but this solution was very gdb/lazdebugger specific, while it can be used more generic.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018