Forum > General
Compiling Lazarus
440bx:
Hello,
As some of you already know, Lazarus cannot and should _not_ be built using the .lpi file it comes with.
I was wondering about what exactly prevents compiling Lazarus using its .lpi file and could whatever the reason(s) is/are be reasonably and successfully circumvented ?
IOW, what makes Lazarus the one (or one of the very few) program(s) developed using Lazarus that cannot be built using its .lpi file ?
Thank you for your help.
af0815:
who know (or say) this ?
It is not the prefered/usual way. Normal use the internal recompile or the make way - yes. But, if you want to debug Lazarus, you must compile Lazarus with the lpi.
And dont forget for lazbuild and startlazarus, this two programm are often forgotten to make all working like a charm. This can be a reason for people to say, dont use the lazarus.lpi alone.
440bx:
--- Quote from: af0815 on September 03, 2024, 06:13:25 am ---who know (or say) this ?
<snip>
But, if you want to debug Lazarus, you must compile Lazarus with the lpi.
--- End quote ---
No, I learned the hard way that doesn't work. if you want to know all the details, you can find them in this thread: https://forum.lazarus.freepascal.org/index.php/topic,67710.msg521851.html#msg521851
Compiling using the .lpi resulted in a mess.
That said, if anyone can provide a way to successfully use the .lpi to produce a workable and debuggable version of Lazarus, I'd very much appreciate that.
MarkMLl:
--- Quote from: 440bx on September 03, 2024, 06:58:29 am ---Compiling using the .lpi resulted in a mess.
--- End quote ---
"Up to a point, Lord Copper."
/First/, build using the makefile. Start the IDE to make sure that a configuration directory exists or is created. After that rebuild using lazbuild (i.e. the .lpi file etc.) since that is the only way to incorporate extra packages ** .
** Other than doing it from inside the IDE, but that results in a mess if you are trying to maintain parallel binaries for e.g. Qt and GTK.
I went through this exercise repeatedly a few months ago, when I wanted binaries (etc.) for Qt and GTK, and wanted LazMapViewer etc. installed in both. Ended up with quite a long (but maintainable) shell script.
MarkMLl
BrunoK:
Windows only.
=============
My folder structure :
Structure du dossier pour le volume HD
Le num‚ro de s‚rie du volume est 000000AA D264:A136
C:\FPC-LAZ
| etc...
|
|+---fpc
| +---3.2.2-git
| | etc...
| \---win_utils
| +---i386-win32
| | +---fpc-306
| | \---fpc264
| \---x86_64-win64
| etc...
+---Lazarus
| +---3.2
| | etc...
| +---3.99_GIT_240829 (0)
| | +---Config (1)
| | | etc...
| | +---Config_dbg (2)
| | | etc...
| | +---ide (3)
| | | etc...
| etc...
See how paths look compared to you own install and adjust.
(0) Where I cloned the last lazarus GIT version
(1) The configuration directory for normal installation
(2) The configuration directory for the debug version
(3) Paste attached project files lazarus_dbg.* to (3-ide)
In (0) I have a working lazarus.exe for which the windows shortcut is :
Target = C:\fpc-laz\Lazarus\3.99_GIT_240829\lazarus.exe --pcp=Config --nsc
Execute above lazarus, maybe adjust paths.
Once in lazarus, tool\configure build lazarus with options
Clean all checked.
-MObjFPC
-Scghi
-O1
-OoREGVAR
-gw3
-gl
-Xg
-OoREGVAR can be omitted but I didn't see that it caused trouble.
If build success, if it didn't restart automatically exit lazarus and reentrer.
Load previously copied lazarus_dbg.lpi, do a simple compile, the project will use the same units that where built in the previous step. (The lazarus_dbg does not automatically compile !).
Depending on the result you may need to adjust C:\fpc-laz\Lazarus\3.99_GIT_240829\ide\staticpackages.inc according to your needs and the lazarus_dbg project parameters in RUN/Run_parameters so it points to the correct config.
Report messages of the built. (Hover on the message of interest with the mouse and hit ctr+c to catch it to the clipboard).
If all goes well you can run the compiled project and from that debug lazarus, you can also run an other application that might interact with the debug lazarus in places of interest.
IF YOU GET THERE NEVER FORGET WHICH instance of lazarus you are in. Its is very easy to be confused ... :-)
Edit : rename lazarus_dbg.lpi.txt to lazarus_dbg.lpi !
Navigation
[0] Message Index
[#] Next page