View Issue Details

IDProjectCategoryView StatusLast Update
0038170LazarusIDEpublic2021-04-13 23:49
ReporterAlfred Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Target Version2.2 
Summary0038170: Wrong unit search path when using relative path for output binary
DescriptionWhen creating a new Lazarus project with Lazarus itself, a nice -FU is created:
lib\$(TargetCPU)-$(TargetOS)
As standard practice, the above can also be used for the binary output -o:
bin\$(TargetCPU)-$(TargetOS)\$NameOnly($(ProjFile))

Setting the binary output to a relative path works well except for the inclusion of other unit files -Fu !

The resulting FPC link*.res file is created inside the bin directory. It uses the command line as created by Lazarus. Lazarus adds the -Fu options as a relative path relative to the original lpi-file. Lazarus should add them relative to the binary output path, where all the linking happens.

Example.
If the project has an extra unit named unit2.pas inside a directory myextraunit, this directory is included as ".\myunit\". But this directory will never be found due to the fact that the linking happens inside the binary path "\bin\$(TargetCPU)-$(TargetOS)"
Additional InformationThe -Fu options are added inside ConvertSearchPathToCmdLine. The are included as-is. However, this inclusion should use the correct relative paths, or switch towards absolute paths, as is done with the binary output -o.
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

Juha Manninen

2021-02-21 10:39

developer   ~0129054

This is a valid issue. How it went unnoticed for many years? Must be fixed for Lazarus 2.2.

Issue History

Date Modified Username Field Change
2020-12-05 08:12 Alfred New Issue
2021-02-21 10:39 Juha Manninen Note Added: 0129054
2021-02-21 10:39 Juha Manninen Target Version => 2.2
2021-02-21 10:39 Juha Manninen LazTarget => -