Lazarus debugger invalidinvalid json如何解决决

8 相关软件 105M/中文/ 32.5M/中文/ 7.6M/中文/ 1.7M/英文/ 1.7M/中文/ 419KB/中文/ 134KB/中文/ 7.2M/中文/ 1.24G/中文/ 1.8M/英文/顶好评:50%踩坏评:50请简要描述您遇到的错误,我们将尽快予以修正。轮坛转帖HTML方式轮坛转帖UBB方式
Lazarus 是一款用于&FreePascal&的快速应用开发(RAD)的面向对象的 Pascal 集成开发环境(IDE)。Lazarus 对于窗口管理来说是中性的。可以工作在KDE(1.13版本)下,也可以工作在GNOME(1.23版本)或其他窗口管理器(MVM、 WindowMaker)。Lazarus 的设计目标是应用 Free Pascal,所以所有凡是FreePascal&能运行的平台,Lazarus 都可以运行。绿色版本特点:1、绿色版本,不需要安装,解压后,设置build.bat 后自行编译即可用,与原来安装的任意版本不冲突,可同时运行,不相互干扰。使用的FPC 版本号为 2.6.1 ,此版本为Win32 版本,此版本是2.6.0 的官方修正版本。自带官方CHM 格式帮助文件。所有文件在docs\chm 文件夹中。2、下载解压到任意文件夹(不要使用中文路径,尽量使用短英文路径),不需要安装;3、在解压后的文件夹中找到build.bat 这个批处理文件,右击编辑,修改第4 行:SET FPC_BIN_PATH=F:\lazarus106\fpc\2.6.1为您解压后的路径。只需修改F:\lazarus106 这个路径就OK 了。4、 现在您可以双击build.bat 来构建Lazarus 了,请耐心等待批处理的完成:5、批处理完成以后,您可以双击lazarus.exe 运行lazarus 了,出现欢迎来到Lazarus IDE 的界面:点击 Start IDE 就开始了。6、让我们设置一下GDB 调试器的类型和路径:选择菜单Tools -& Options -& 左边选择Debugger -& 右边在Debugger type and path 中选择GNU debugger (gdb),如下图:7、添加F1 帮助文件:选择菜单Tools -& Options -& 左边选择 Help -& 右边在Viewers 中选择CHM Help Viewer,如下图:在Properties 中的HelpExe 中选择lhelp.exe 的路径,在HelpFilesPath 中选择CHM 文件夹路径,如下图:至此,所有的调整和设置已完成,重启一下Lazarus,可以开始使用Lazarus 1.0 .6 绿色版了。
Lazarus中文版怎么设置:启动Lazarus IDE,点击菜单栏中的tool(工具)--再点击Options(选项)在弹出的IDE选项框内,点选左侧Environment下的Desktop(桌面)子选项,将Language设为Chinese [zh_CN]最后关掉重启一遍Lazarus即可。
1.0.6 绿色中文版
下载帮助西西破解版软件均来自互联网, 如有侵犯您的版权, 请与我们联系。Browse /Lazarus Windows 32 bits/Lazarus 1.4 at SourceForge.net
The interactive file manager requires Javascript. Please enable it or use .
You may still browse the files here.
Looking for the latest version?
Lazarus 1.4
Downloads / Week
Totals: 4 Items
This folder contains the installer for the 32 bit version of Lazarus 1.4. This installation is for all supported 32 and 64 bit versions of Windows.
* The default installer is:
lazarus-1.4-fpc-2.6.4-win32.exe
You should download this file, if you want to work on any Windows 32 or 64 bit version.
The installers include FPC 2.6.4 and they include the Lazarus help files.
* Add-On for building 64bit Windows applications:
lazarus-1.4-fpc-2.6.4-cross-x86_64-win64-win32.exe
This file can be installed as add-on to the 32 bit Lazarus IDE (on Systems with Windows 32 or 64 bit), if you wish to develop for 64bit Windows too.
If you install this on a 64bit Windows PC together with the 32 bit Lazarus IDE, you will also able to debug 64 bit applications.
Please read: http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29
* Add-On for WinCE development ONLY:
lazarus-1.4-fpc-2.6.4-cross-arm-wince-win32.exe
This file can be installed as add-on to the 32 bit Lazarus IDE, if you wish to develop for WinCE.
*** Note on debugging ***
The installers come with GDB 7.2. According to our tests newer versions of GDB are less stable or otherwise faulty when used to debug FPC generated executables.
On some installations of Win 7 or newer Windows this version does not run stable. On other Win 7 this gdb is still stable. Most likely problems are crashes, when the open/save dialogs are used.
If you experience this issue, please try the workaround:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working
In the debugger options and set the field "DisableLoadSymbolsForLibraries" to "True".
If this does not help download the "alternative gdb" from the listed downloads.
For an overview what changed from 1.2 and 1.2x Versions (includes incompatibilities with earlier versions) see:
- http://wiki.lazarus.freepascal.org/Lazarus_1.4.0_release_notes
- http://wiki.lazarus.freepascal.org/User_Changes_2.6.4
For additional information visit our homepage, forum, wiki, and FAQ:
- http://www.lazarus.freepascal.org/
- http://forum.lazarus.freepascal.org/
- http://wiki.lazarus.freepascal.org/Lazarus_Faq
Source: README.txt, updated
googletag.cmd.push(function() {
googletag.display('div-gpt-ad-1-0');From Lazarus wiki
(Redirected from )
│ 
 │ 
 │ 
English (en) │ 
 │ 
 │ 
 │ 
 │ 
 │ 
 │ 
 │ 
 │ 
 │ 
 │ 
 │ 
Lazarus is a cross-platform integrated development environment (IDE) that lets you create visual (GUI) and non-visual Object
programs, and uses the Free Pascal compiler to generate your executable. Its aim is write once, compile anywhere: you should be able to just recompile your program source code with Lazarus running on another operating system (or a cross compiler) and get a program that runs on that operating system.
For more details see
The binaries are big because they include a lot of debug information necessary for using gdb (GNU Debugger).
A debugger is a program that is used to test your code. It uses the extra-information stored in your binary to test it. But once your program is working well, you may delete those infos and reduce the size of the binary.
Quick guide to Lazarus/FPC application size reduction
1. Project|Compiler Options|Code|Smart Linkable (-CX) -& Checked
2. Project|Compiler Options|Linking|Debugging| Uncheck all except Strip Symbols From Executable (-Xs)
3. Project|Compiler Options|Linking|Link Style|Link Smart (-XX) -& Checked
only do this if you don't need to run the debugger. For more details, see
Lazarus executable size starts big, but grows very slowly, because of the way the LCL is designed, and its use of certain Free Pascal features (RTTI). Projects that don't use the LCL are much smaller (this is similar to some non-GUI C++ frameworks). This typically requires more manual coding though.
You only need fpc.cfg. This way the compiler knows where to find the libraries.
Do something like this:
$ cd lazarus
$ make clean all
If you want to build Lazarus for different widgetset eg. Qt (supported on Linux, Windows and OSX) then use the LCL_PLATFORM argument:
$ cd lazarus
$ make clean all LCL_PLATFORM=qt
If you want to compile projects automatically or from the command line, use . This is a command line version of the IDE to build Lazarus projects and packages.
If you want to build LCL applications without the IDE and without lazbuild, add the following lines to the end of your fpc.cfg
# searchpath for other toolkits (Linux)
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/{YourToolKit}
# searchpath for other toolkits (Windows)
-Fu/{YourLazarusDirectory}/components/lazutils/lib/{platform}
-Fu/{YourLazarusDirectory}/lcl/units/{platform}
-Fu/{YourLazarusDirectory}/lcl/units/{platform}/{YourToolKit}
Where {YourToolKit} may be gtk2, gnome, qt or win32 and {platform} may be x86_64-linux and run:
ppc386 your.project.pp
Hint: Don't forget to install the development packages for your toolkit otherwise you might receive something like: .
Lazarus 1.0.8 requires at least FPC 2.6.2.
Lazarus 1.0 requires at least FPC 2.6.0.
Check if the compiler is the correct version
Check if the (fpc) libraries are from the same version
Check if the compiler installation path has spaces in it. Make sure it doesn't!
Check if you have a fpc.cfg and no old ppc386.cfg
Check also the OS-dependent FAQs
If you're still stuck, ask on the forum or Lazarus mailing list
Both Lazarus resource and Windows-type/FPC resources are supported. See .
explains some extensions by an example.
Here is a brief list:
description
Lazarus Project Information
contains project-specific settings like compiler settings and needed packages. stored in XML
Lazarus Program Session
Personal data like cursor positions, source editor files, personal build modes. stored in XML
Lazarus Program
Pascal source of main program.
Lazarus Form
Form configuration information for all objects on a form (stored in a Lazarus-specific textual format, similar to D the actions are described by Pascal source code in a corresponding *.pas file)
Pascal code
Pascal code typically for a form stored in a corresponding *.lfm file
Lazarus Resource
Generated Lazarus R not to be confused with a Windows resource file.
This file can be created with lazres tool (in directory Lazarus/Tools) using commandline: lazres myfile.lrs myfile.lfm
Compiled unit
Compiled source code created by the Free Pascal compiler for each unit and program.
Object file
created by the compiler, every ppu file has a corresponding o file, needed by the linker.
Lazarus package information
package-specific settings, like compiler settings stored in XML
Lazarus Resourcestring table
Lazarus Resourcestring table created when saving a lfm file and i18n is enabled. It contains the TTranslateString properties of the lfm. Do not edit them, they are overwritten.
Resourcestring table
Resourcestring table created by the compiler for every unit with a resourcestring section. Do not edit them, they are overwritten.
gnu gettext messages
is enabled the IDE creates/updated the .po files with the resourcestrings from the rst and lrt files.
The TForm.Width/Height do no include the frame, because there was no way to retrieve the frame size on all platforms. Without a reliable way, the LCL would move the forms around on the screen or resize them endlessly.
Eventually it will be changed when there is a reliable way to get the size and position of a window with its frame on all platforms. To keep compatibility with older LCL forms, a version number and some extra methods will be added.
Platform specific errors/problems are also covered in sections below.
A common thing happened to a new user when one wants to create two forms referencing each other's properties. The error above only happens to uses clause of interface section, thus it's OK to put it in implementation section. Example:
This one causes error:
implementation
implementation
But this one doesn't:
implementation
implementation
In some cases the minimal base class method might be suitable.
Separate one class into a minimal base class (what the other needs) and derive it for the rest of the implementation.
unita: uses unitb
ClassA = class(BaseClassA)
// rest of ClassA
ClassB = class;
//forward declaration
BaseClassA = class
// references ClassB
ClassB = class
// references BaseClassA
Discussion:
The TControl class has a
property. In a method of a form, that has higher visibility, the
type from the system unit. You can use the
type, which is just an alias for the Text type or you can add the unit to the type definition.
MyTextFile: TextFile;
MyText: System.Text;
A similar name clash exists with assigning and closing a text file. TForm has a assign and a
method. You can use
or add the unit name System.
The unit Printers must be added to the uses section.
The Printer4Lazarus package must be added to your project requirement in the IDE under:
Project|Project Inspector|Add|New Requirement|Package Name:
If the package Printer4Lazarus package is not in the list when opening the dropdown box it must be installed. The package is part of the Lazarus installation and can be found in:
[lazarus installed directory]\components\printers
If you used the default installation directories [lazarus installed directory] is:
Windows: c:\lazarus
Linux: /usr/lib/lazarus
The same solution also applies to the exception you can get when referencing Printer.Printers
Please see
For information on the error "Cannot find unit interfaces", see the next section.
This error means that the compiler can not find the file 'interfaces.ppu' or the file was found, but it is wrong or outdated (the .ppu file date code is older than the date code of the compiler itself). Testing the compiler option settings can help debug these issues, via Project: Compiler Options... (use the Test button at the bottom of the dialog). This test also lets you check that the {TargetCPU} and {TargetOS} variables are set properly.
The interfaces unit can be found in {LazarusDir}\lcl\units\{TargetCPU}-{TargetOS}\{LCLWidgetSet}\interfaces.ppu. For example: /home/username/lazarus/lcl/units/i386-linux/gtk/interfaces.ppu.
It is normal to have multiple versions of interfaces.ppu (in the proper directories) to allow compiling with different widgets.
If the interface.ppu file is in the folder matching the OS and CPU you selected in the project preferences, and you get this error, you are using a different compiler / RTL for compiling your project than you used for compiling your Lazarus IDE, or the libraries need to be recompiled to give the .ppu files newer compilation dates.
You can do one of the following:
Set the compiler in the Environment Options to the one you used to compile Lazarus. Also look carefully in the Environment Options to see if you are using the correct paths for the Lazarus directory and the FPC sources directory. Check that there is only one version of the compiler configuration file fpc.cfg - it should reside in /etc/ for Linux/Unix systems or in the same directory as the fpc compiler for Windows systems. Try to run "fpc -vt bogus" to check which fpc.cfg is being used in your system. Rogue copies often creep in if you have updated your compi they may be found in your home directory or in the same directory as the one in which you built your new compiler. DELETE THESE!
Rebuild the LCL (or Lazarus completely) with the compiler selected in the Environmnent Options. You can do this with Tools -& Build Lazarus. Before doing this, check the current settings in Tools -& Configure Build Lazarus.
You may also try to change the widgetset currently selected for the project. For example, the sample project "objectinspector" that comes with Lazarus is set to gtk by default. Compiling this project will surely give you "Can't find unit interfaces" in Windows platform. Changing widgetset to default(Win32) in
should fix this issue.
Here is an example for such a linker error:
/path/to/lazarus/lcl/units/x86_64-linux/wsimglist.o: In function `REGISTERCUSTOMIMAGELIST':
/path/to/lazarus/lcl//widgetset/wsimglist.pp:266: undefined reference to `WSRegisterCustomImageList'
Make sure yor project uses the package LCL. You can check this in the project inspector.
Make sure unit "interfaces" is used as one of the first units of your program.
Note: These functions are implemented by the LCL backends. By adding the unit interfaces, you link a LCL backend into your program.
Lazarus (or better Linux) doesn't know about resources, so you can't use them in the way Delphi/Win32 does. However Lazarus uses a method pretty compatible with this. You can still use your Delphi layouts (.dfm files) if you use the following steps:
You need a textual version of the .dfm files. D5 and higher are doing this by default. If you have older files: Alt+F12 to see the layout as text and paste/copy. When you have a text .dfm file, just copy it to a .lfm file.
Create a file with lazres (in lazarus/tools) lazres yourform.lrs yourform.lfm
Add the following initialization section to
initialization
{$I yourform.lrs}
Please keep in mind that not all properties in the dfm are supported yet by Lazarus, so you might get a crash.
Edit: Since FPC 2.4.0, Delphi style resources are supported, so you don't need to change anything. Even Lazarus SVN already uses it as default projects. Note: it's still advised that you use Lazarus' Delphi project converter as there might still be unsupported properties.
When creating a form Lazarus automaticaly add some extra units to the uses section of your form unit. During the conversion of a delphi unit to a Lazarus unit this does not happen. So you need to add LResources to the Uses section of your form unit.
Make sure, in the Project -& Project Inspector, that your project depends on the package "LCL" and that you have installed the FPC sources.
Lazarus is the IDE and the visual components library LCL.
All other stuff, like IO, Database, FCL and RTL are provided by FPC.
The IDE needs the paths to all sources.
The FPC source path can be set via:
Environment -& Environment Options -& Files -& FPC source directory
An internal error is a compiler error that is not expected to happen (but is prepared to easily track down the problem if happens by giving code XXXXYYZZW). Every internal error is a bug, thus it's advised to report to the bugtracker (with small example that can demonstrate the internal error) when one gets it.
If you try to open a project like "/home/bart/space /test.lpi" (note the space just before /test.lpi), the Lazarus IDE will give an error saying it cannot find "/home/bart/space /test.lpi".
This is a known limit of the IDE, which is caused by the fact that the IDE a.o. has to handle paths that users have supplied in edit controls, which have to be stripped from surrounding spaces.
This limitation in no way affects user programs written in Fpc/Lazarus.
Avoid such pathnames for projects.
See also .
You have to use FPC 2.4 or newer.
If you compile your application using -gw (dwarf debug info), you should be able to inspect properties.
Note: This is only true for properties that map directly to a variable (the "read" declaration points to a member, not a function).
If your property returns the value of a function it is very dangerous to evaluate/inspect it. It would require this function to be called, and very often it would change the values of some of your variables. This would mean it would alter the state of your application in the debugger, and any further code-execution, debugging or inspections would return incorrect results.
The optional ability to explicitly inspect the results of functions (with the risks described), and therefore calling code from the debugger is not yet implemented
For problems debugging:
properties
Array of ... (Dynamic Array)
Variables in Nested Procedures
"no such symbol in context"
"incomplete type"
Please see
FCL components and classes are built without debug information by default and as a result, gdb cannot access component methods or properties. To build package components they must be rebuilt with a debug-line information "-gl" switch.
This example assumes you have a Linux distribution with /usr/local/ installation prefix and that the Database package fcl-db is what is needed to contain debug-line information.
While the fcl-db is used in this example, you may issue this make command from ANY of the included packages.
Before you begin, you need to locate your FPC path by examining your FPC configuration file.
The file (fpc.cfg) is located at /etc/fpc.cfg.
Display the contents of fpc.cfg and find your fpc installation path.
Look for a line starting with -Fu in the fpc.cfg:
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*
Make scripts are installing units into INSTALL_PATH/lib/fpc/$fpcversion/units/$fpctarget/,
so you must be sure that /usr/local is the installation path, and should be assigned to INSTALL_PREFIX, otherwise the Make scripts will place units where they don't belong or the Make script will fail.
Step 1: Open a shell terminal
Step 2: cd /user/local/share/src/fpc-2.3.1/fpc/fcl-db/
Step 3: sudo make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
Note: INSTALL_PREFIX parameter should be properly configured for units to be installed.
In the sample below /usr/local is a default fpc path for Linux, but may vary on other OSes.
make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
Finally, after rebuilding any FCL units you may want to rebuild LCL as well.
Lazarus provides a basic log framework in the unit . See that page for more details.
Lazarus itself uses .
This means that you can run Lazarus with --debug-log=lazarusdebuglog.txt
If this is not sufficient: in the IDE the extent of the information that is logged can be controlled with --debug-enable. See --help for a list of keywords, or install the package IdeLazLogger.
If you want output on a console (most useful for Windows), add {$APPTYPE console} to lazarus.pp ; Then rebuild Lazarus.
Such patches will not be applied, because they only implement a small part of the needed docking. The goal is to create a complete dock manager and use that. A complete dock manager can dock all IDE windows and it allows to let the user define how to dock. For example dock the messages window above or below the source editor — or not at all. For instance,
+-------------------++--+
+-------------------+|
+--++---------------+|
|PI|| Source Editor ||CE|
|+---------------++--+
|OI|+-------------------+
||messages
+--++-------------------+
The dock manager can store the layout and restore it on next load. Preferably the dock manager can dock in pages too. The dock manager does not need to use drag and drop.
All patches implementing docking without a dock manager makes it harder to implement a real dock manager and will be rejected.
An example for such a dock manager is the package anchordockdsgn,
Create a patch and send it to the developers. For details, see .
Please see
First of all, you must learn about Lazarus, to prove your knowledge and skill.
Start by reading the
wiki article, read the Lazarus source code, giving a look at the , fix some bugs, and if you think you are ready, contact the developers on the .
Virtual key constants are defined in . Add LCLtype to your uses.
You can invoke identifier completion by pressing [ctrl][space].
Under the menu item Environment -& Editor Options -& Code Tools -& Automatic Features you can set how quick this should happen automatically.
Yes, see the menu item Tools -& Options and use the Editor/Display and Colors sections. On Windows you may find that the default Courier (and some other typefaces) are either too sharp or too soft, either selecting/deselecting 'Disable anti-aliasing'. TrueType fonts are an improvement, such as the free "Bitstream Vera Sans Mono" font available from . (To install a new font, unzip and copy the files into a suitable folder. In Windows XP you will need to use the Fonts section of the Control Panel. In Windows 7 you may select all the font files, right-click and find an Install option in the pop-up menu)
Maybe your language support is not installed correctly. Go to System Settings & Language Support. If it asks you to install the language support, click "Install". Log off and in again.
Check the value of your environment variable GTK_IM_MODULE. In a terminal type:
env | grep GTK_IM_MODULE
If this gives nothing or "xim", you should set it. Under Ubuntu 14.10 the following works:
GTK_IM_MODULE=ibus ./lazarus
GTK_IM_MODULE=gtk-im-context-xim ./lazarus
To set that automatically you can add a line to /etc/bash.bashrc:
export GTK_IM_MODULE=ibus
First of all you need a debugger. gdb is the standard debugger under linux and
there are several GUI-frontends available. One common frontend is ddd, which is
part of most common distributions. To compile lazarus/lcl with debug-information
you should then use the following commands to start a debug session:
$ make make OPT=-dDEBUG
$ ddd lazarus
Be warned, however, that ddd is not as comfortable as, e.g., the Lazarus debugger, especially if it comes to view the contents of a variable you have to take into account that ddd/gdb are case sensitive whereas Pascal is case-insensitive.
Therefore, you have to type all variable names in uppercase to see their contents. For more information see the fpc-manuals.
This is a path-related problem with either gdb or ddd. You can avoid this by
Use the "Change directory" command from the ddd menu and choose the directory where the sources are located. The drawback of this method is that you now can't use the source of the program you started with (e.g. lazarus). Thus it may be neccessary to change the directory multiple times.
In ddd goto [Edit] [gdb-settings] and set the search-path
Create a $(HOME)/.gdbinit file like:
directory /your/path/to/lazarus
directory /your/path/to/lazarus/lcl
directory /your/path/to/lazarus/lcl/include
For example:
/usr/bin/ld: cannot find -lgdk
This means an external library was not found. In the above case under Linux it means the libgdk.so or libgdk.a was not found. Normally this means, you forgot to install the development package of this library. In the case of gdk the package is called under the Fedora Core distribution: 'gtk+-devel-1.2.10-33'.
Package Based Distributions  You need to install the package that provides the lib&somelib&.so or lib&somelib&.a files. Dynamic libs under linux have the extension .so, while static libs have the extension .a. On some Linux distro's you have installed the package (rpm, deb) &packagename& which provides &some lib&, but you also need the development package (rpm, deb), normally called &packagename&-dev, which contains the .a (static lib) and/or the .so (dynamic lib).
Some distributions have commands to find which package contains a file:
urpmf lib&somelib&.so
will list all packages containing the file named lib&somelib&.so, you'll have to install those ending in -devel
install the apt-file utility (apt-get install apt-file) then
apt-file search lib&somelib&.so
will list all packages containing the file named lib&somelib&.so, you'll have to install those ending in -dev
SuSE installs the gtk devel libs under /opt/gnome/lib (or /opt/gnome/lib64 for 64 bits), which is not in the standard lib path. Simply add it to your /etc/fpc.cfg. (-Fl/opt/gnome/lib).
Source Based Distributions and Manual Compilation (LFS)  Make sure that there is a lib&somelib&.a in the path, and that it contains the right version. To let the linker find the dynamic library, create a symlink called lib&some lib&.so to lib&some lib&&version&-x,y.so if necessary (and/ lib&some lib&.a to lib&some lib&&version&-x,y.a).
FreeBSD : As source based distro's, and also make sure you have -Fl/usr/local/lib in your fpc.cfg and/or Lazarus library path. Keep in mind that GTK1.2 has "gtk12" as package name under FreeBSD. (same for glib) NOTE: This has changed as of late. Newest ports have gtk-12 and glib-12 as well. You might stumble on this problem, since FPC requires the "-less" ones, you will need to symlink them like this:
cd /usr/local/lib && ln -s libglib-12.so libglib12.so
cd /usr/X11R6/lib && ln -s libgtk-12.so libgtk12.so
cd /usr/X11R6/lib && ln -s libgdk-12.so libgdk12.so
NetBSD : As source based distro's, and also make sure you have -Fl/usr/pkg/lib in your fpc.cfg and/or Lazarus library path
Fedora : In the "add/remove software" panel search for: "gtk2-devel", "glibc-devel" ([]), "libx11-devel"
Nearly the same way as converting a Kylix project into a Delphi/VCL project.
The LCL (Lazarus Component Library) tries to be compatible to Delphi's VCL.
Kylix's CLX tries to be QT compatible.
Here are some general hints:
Rename all used CLX Q-units like QForms, QControls, QGraphics, ... into their VCL counterparts: Forms, Controls, Graphics, ...
Add LResources to the uses section of every form source
Rename or copy all .xfm files to .lfm files.
Rename or copy .dpr file to .lpr file.
Add "Interfaces" to the uses section in the .lpr file.
Remove {$R *.res} directive
Remove {$R *.xfm} directive
Add {$mode objfpc}{$H+} or {$mode delphi}{$H+} directive to .pas and .lpr files
Add an initialization section to the end of each form source and add an include directive for the .lrs file (Lazarus resource file):
initialization
{$I unit1.lrs}
The .lrs files can be created via the lazres tool in: (lazarusdir)/tools/lazres.
For example: ./lazres unit1.lrs unit1.lfm
Fix the differences. The LCL does not yet support every property of the VCL and the CLX is not fully VCL compatible.
To make it more platform independent, reduce unit libc (which is deprecated) references and substitute with native FPC units like baseunix/unix as much as possible. This will be necessary to support other targets than linux/x86 (including OS X, FreeBSD and Linux/x86_64)
1. Check a clean rebuild: do a 'make clean all'
2. Check if the compiler has the correct version (2.0.4 or higher)
3. Check if the compiler is using the right config file. The normal installation creates /etc/fpc.cfg. But fpc also searches for ~/.ppc386.cfg, ~/.fpc.cfg, /etc/ppc386.cfg and it uses only the first it finds.
Hint: You can see which config file is used with 'ppc386 -vt bogus'
Remove any ppc386.cfg as it is really obsolete.
4. Check if the config file (/etc/fpc.cfg) contains the right paths to your fpc libs. There must be three lines like this:
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
The first part of these paths (/usr/lib/fpc) depends on your system. On some systems this can be for example /usr/local/lib/fpc/... .
Hint: You can see your searchpaths with 'ppc386 -vt bogus'
5. Check that the config file (/etc/fpc.cfg) does not contain search paths to the lcl source files (.pp, .pas):
forbidden: -Fu(lazarus_source_directory)/lcl
forbidden: -Fu(lazarus_source_directory)/lcl/interfaces/gtk
If you want to add the lcl for all your fpc projects, make sure that the two paths look like the following and are placed after the above fpc lib paths:
-Fu(lazarus_source_directory)/lcl/units/$fpctarget
-Fu(lazarus_source_directory)/lcl/units/$fpctarget/gtk
6. Check if the missing unit (glib.ppu) exists in your fpc lib directory. For example the gtk.ppu can be found in /usr/lib/fpc/$fpcversion/units/i386-linux/gtk/. If it does not exists, the fpc lib is corrupt and should be reinstalled.
7. Check if the sources are in a NFS mounted directory. In some cases the NFS updates created files incorrectly. Please, try to move the sources into a non NFS directory and compile there.
8. If you are still not succeeded try to use samplecfg script as follows:
# cd /usr/lib/fpc/version/
# sudo ./samplecfg /usr/lib/fpc/\$version /etc
Note: Do not a slash ("/") after etc, because if you do, the system will create a folder /etc/fpc.cfg/fpc.cfg. In fact, we want samplecfg to make a file /etc/fpc.cfg, not the folder /etc/fpc.cfg.
Probably you are using a newer fpc package, than that used for building the
lazarus binaries. The best solution is to download the sources and compile
lazarus manually. You can download the source snapshot or get the source
$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
$ cd lazarus
$ make clean all
Make sure that Lazarus get the new source directory:
Environment-&General Options-&Files-&Lazarus Directory Top
Install the gdk-pixbuf library for gtk1.x:
Where to find the gdk-pixbuf library:
Debian packages:
libgdk-pixbuf-dev
Ubuntu 8.10:
If you are compiling Lazarus with GTK 2.0 you'll get a "libgdk-pixbuf2.0" not found error. Just install libgtk2.0-dev using apt on
apt-get install libgtk2.0-dev
Older SuSE versions (before SuSE 11) install the gtk devel libs under /opt/gnome/lib (or /opt/gnome/lib64 for 64 bits), which is not in the standard lib path. Simply add it to your /etc/fpc.cfg (-Fl/opt/gnome/lib).
You can either use the QT or the GTK2 backend. Default is GTK2. For GTK2 install the kubuntu package libgtk2.0-dev.
After I installed a component, Lazarus crashes with the following message:
Threading has been used before cthreads was initialized.
Make cthreads one of the first units in your uses clause.
Runtime error 211 at $
How can I fix this?
Your freshly installed component is using threads. FPC on *nix doesn't automatically include threading support, but it must be intialized. This initialization is done in the cthreads unit. Every application using the component needs to add this unit to the uses clause of the main program. Lazarus itself is no exception. This can be done in two ways:
1) Open the package. In the package editor click on Options. Under page Usage add to the custom options -dUseCThreads. Then rebuild the IDE. This way the cthreads unit will be automatically used by the IDE under unix and the cthreads are initialized.
2) In order to avoid modifying package, an FPC compiler option could be used directly. Open menu Tools-&Configure "build Lazarus". "Configure build Lazarus"
in field "Options:" type -Facthreads and then press "OK" button. The next step is to install the package. Lazarus will be built with option -Facthreads which means that it will treat main program as if unit cthreads where first in uses clause.
Hint: Maybe your old (non-crashing) Lazarus executable is stored as lazarus.old in the same directory as the crashing Lazarus executable.
The complete error message is:
This binary has no thread support compiled in.
Recompile the application with a thread-driver in the program uses
clause before other units using thread.
Runtime error 232
Solution: Add cthreads as first unit to the uses clause of your main program, usually the .lpr-file.
If Lazarus is compiled with Gtk1.2, the settings in Gnome Preferences/Font don't have any effect as
they are related to Gtk2.
You could try this solution:
Create a file named .gtkrc.mine in your home directory (if it's not already there) and add
these lines to it:
style &default-text& {
fontset = &-*-arial-medium-r-normal--*-100-*-*-*-*-iso8859-1,\
-*-helvetica-medium-r-normal--*-100-*-*-*-*-*-*&
class &GtkWidget& style &default-text&
If this is not enough try and create also a .gtkrc symlink to .gtkrc.mine . It worked in this way under Xubuntu 7.10, Mandriva 2009.0 KDE3.
Name the rc file yourprogram.gtkrc and put it in the same directory where the executable is.
Use unit GtkInt and call GTKWidgetSet.SetRCFilename('your_preferred_rc_file');
Best done before Application.Initialize in the .lpr file with {$IFDEF LCLGtk}.
Use unit gtk2 and call gtk_rc_parse('your_rc_file')); and gtk_rc_reparse_.
Ubuntu has a problem with not creating all the symbolic links that you'll need even when the libraries are installed.
Make sure that all missing libraries when trying to link for Gtk2 have their appropriate links.
For instance, you might need to do:
cd /usr/lib
sudo ln -s libgdk-x11-2.0.so.0 libgtk-x11-2.0.so
Make sure that the [whatever].so symbolic links are created and point to the actual libraries.
At the moment, the Gtk2 compiled IDE is a little unstable, but you can compile software for Gtk2 using the Gtk1 IDE.
To start with recompile LCL for Gtk2. Go to the menu "Tools"-&"Configure Build Lazarus" and set LCL to clean+build and everything else to none.
Now click Ok and go to the menu "Tools"-&"Build Lazarus"
Now you can compile your software with Gtk2 going on the Compiler options and changing the widgetset to Gtk2.
If you use readln(); and writeln(); for your input and output the console window (sometimes called terminal window) is not going to pop up as it does with Windows.
You will need to access this window with View - Debug Windows - Terminal Output.
Unlike with Windows you can not use backspace to correct typing errors.
The 'Enter' key on the numeric keypad may not work either, depending on the widgetset the IDE was built for.
Type carefully!
Because Linux is case sensitive you will need to take care that you pay attention to case when referencing or accessing files.
In the compiler directory there is an OS2 scriptfile named make.cmd. Different versions of Windows also see this as a script file, so remove it since what is needed for OS2 becomes a hindrance on Windows.
Somehow make has lost its path (reason unknown). Try to cycle with a basedir set like:
make cycle BASEDIR=your_fpc_source_dir_herecompiler
You need to upgrade your make.
Make sure you didn't install FPC in a path with spaces in the name. The
Makefile doesn't support it.
Project -& Project Options -& Check 'Use manifest to enables themes'.
Specify the -WG argument (Windows GUI) on the command line of the compiler or in the Lazarus IDE check the Windows GUI check box on the compiler options dialog box (Project menu -& Compiler Options -& Config and Target -& target OS Specific options.
Dead code stripping is not supported by the assembler and linker before Xcode 1.5 (available for Mac OS X 10.3.9). Disable the compiler options
Code & Unit style & Smart linkable (-CX)
and Linking & Link Style & Link smart (-XX)
Yes, the LCL is licensed under the , which allows you to link to it statically without releasing the source of your application. Modifications and enhancements to the LCL must be distributed with source. Lazarus, the IDE, is licensed under the GPL.
The LCL consists only of the code in the directory named "lcl", other code may not be covered by this statement.
Lazarus comes with additional components, that were developed by third parties. Those are under various other Licenses. If you wish to use them you need to see the License within the source files of those packages.
Most of those 3rd party components are in the directory "components".
All LCL units are in the directory "lcl". A list of units belonging to the LCL can be found
. If your code uses units not listed on this page, you may have used a component that is not part of the LCL.
Yes, the IDEIntf part of the IDE is licensed under the LGPL with the same exception, so that shared data structures in this part will not force you to license your plug-in or design-time package under the GPL. You are free to choose a plug- we don't want to limit your choice. Therefore non-GPL compatible plug-ins are allowed. Note that it's not allowed to distribute a precompiled Lazarus with these non-GPL-compatible plugins however, we do not see this as a severe limitation, since recompiling Lazarus is easy.
First and most important: always mention which Lazarus version, Free Pascal version, Widgetset, CPU Architecture and Operating System (with full version) that you are using! Don't just say that you are using "the latest version"; please state the exact version number. For snapshots, the revision number and/or date are also important.
When asking a programming question, always try to include some source code which demonstrates the problem. Please surround your code with [code][/code] tags (or use the Insert code button in the forum post editor toolbar). You can attach complete programs as zip files if you want. Use Lazarus/Project/Publish Project to help with that.
If you get an error on your code, always specify what the error is. Simply copying what the compiler / debugger / your program said should be enough in most cases. If the error happens at runtime, use -gl and disable function inlining when compiling so your program can generate a proper backtrace.
Often an image is also very useful. You can host images in
and other similar websites and then post a link.
Try to provide both a high-level overview of the problem (what goal you want to achieve) as well as a more detailed view of the problem (how are you trying to achieve your goal'. Often, there is a much easier way of getting things done that you may not know about.
Finally, make sure you have searched/read the relevant documentation (e.g. the
and Lazarus wiki, see e.g. . You should also : other people with may already have found solutions to similar problems. If you indicate you have already done a bit of homework, people will in general be much more willing to help.
For more tips about asking questions the smart way, read this:
page for an explanation of the branching and version numbering of Lazarus.
Issues with old Lazarus/FPC versions and notes about upgrading are covered below.
Often, the best so please see the various
Note: This problem was fixed in FPC 2.2 and Lazarus 0.9.24. Please update your Lazarus if you can. For older versions read text below.
Generally speaking, compilation on Windows takes more time then other platforms because the GNU Linker utilized by Free Pascal is slow on this platform. This problem only affects Windows, and is only bad on relatively old computers (less then 1Ghz) and computers with little RAM (128MB or less).
Also, if you smartlink LCL the linking will be much slower. A study about this is located here:
Starting from FPC 2.2, an internal linker is used which decreases the linking time dramatically.
Older versions of FPC (and Lazarus based on it) don't support Windows (.rc/.res) resources, but only LRS files (Lazarus Resource files). See
Since 0.9.30 Lazarus can use fpc resources. That means you can delete the lrs files for forms and replace the include directives {$I unit1.lrs} with {$R *.lfm}.
Excluding the Lazarus directory (and the directory/directories where your project/projects are) from on access virus scanning may help there.
information on what to do when you get "unit not found" messages
Personal tools
This page was last modified on 24 November 2015, at 18:45.
This page has been accessed 276,025 times.}

我要回帖

更多关于 剑灵invalid怎么解决 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信