A N N O U N C E M E N T S |
This FAQ concerns Lazarus 0.9.24. |
---|
Lazarus 0.9.24 for Windows together with FreePascal 2.2.0 is pre-installed (via full install) on laptops of first-year 2008-2009 students in the Department of Mathematics and Computer Science.
You can check this in het Windows START menu under All Programs: Lazarus should be available in a submenu.
You can install Lazarus yourself:
See Getting Started with Lazarus at TU/e.
Unfortunately, we have had instances where even the simplest program fails to run properly from within Lazarus. This is probably related to the debugger. We will look into this issue, but have no solution for Lazarus at the moment. The FreePascal compiler works fine.
Alternatives are:
*.exe
) in a separate
command window (type `cmd
at the START menu).
This way, it is not possible to step through the program's execution. But one could add writeln(...) ; readln statements at appropriate places to accomplish a similar effect.
In the course 2IP05, the use of the debugger is not required. Only in the first week, there is one exercise that explicitly refers to facilities provided by the debugger.
.lpr
or .pas
file.
Compile the program in a command window using
fpc
file.
You need to ensure that the compiler can be found,
by including its path in the environment variable %PATH%
.
It is advisable to compile with the following options:
fpc -CirotR -vewnh -Mdelphi -gl -Sah
file
The options can be put in a configuration file (fpc.cfg
).
Execute your program from the command window (see previous bullit point).
*.dpr
.
The projects that we make available are Lazarus projects.
For Blocks A and B, you can simply rename the *.lpr
file
into *.dpr
and create a Delphi project from that.
Consult Getting Started with Lazarus
to find out about recommended project options
(in particular those for the compiler).
See Running the program in a project.
I consider this a bug.
Workaround. Environment Options ... > Windows: uncheck `Hide IDE windows on run'.
When the program is not yet running and you click Run (or menu Run>Run, or function key F9) to start it, the command window may appear but the program's output does not appear, and the program seems to be stuck.
Workaround. Stop program execution via Run>Stop (Ctrl+F2). Reset the debugger by Run>Reset debugger.
After each run, the debugger should be reset to avoid this problem from reoccuring.
When the program is not yet running and you click Step Over
(or menu item Run>Step Over, or function key F8)
to start it,
a dialog window may appear,
asking you to locate system.inc
. (Bug?)
Dismiss this dialog window by clicking `No'.
Workaround. Set a Breakpoint on the first line after the program's first begin (by clicking next to it in the left margin; this should highlight the line in red and mark it with a red bullet). Then Run > Run (F9) the program. After that, you can use Step Over (F8).
This sometimes does not work for some variables. (Bug?)
N.B.
The program must be active
(the Lazarus Toolbar should have (debugging ...)
in its title)
in order to inspect variables.
Workaround. Put the variable in the Watch List: View > Debug windows > Watches, double click on the topmost empty line, and enter the variable's name next to Expression, click OK.
One should be careful about renaming files that belong to a Lazarus project.
N.B.
File names appear in several places,
such as the *.lpi
Lazarus Project Information file,
and (explicitly or implicitly) in uses
clauses
to indicate dependence on units in other files.
When changing a file name,
this should usually be done in a consistent manner.
Workaround. Open the file to be renamed in the Source Editor. Use File > Save As ... to save a copy under the changed name. Find (e.g. through the Search menu) other files in the project that somehow reference the old name. Change relevant occurrences to the new name. Remove the old file from the project, and add the new file to the project. Delete the old file or move it outside the project folder, to avoid confusion.
N.B. Opening a file belonging to a project, and removing from/adding to the project can all be done through Project > Project Inspector.