Recent

Author Topic: Lazarus doesn't find FPC unit even though path is correct  (Read 2583 times)

acp693

  • Jr. Member
  • **
  • Posts: 73
Lazarus doesn't find FPC unit even though path is correct
« on: November 20, 2021, 09:30:43 pm »
I used Lazarus about 10 years ago and found it to be great software. I'm now in the process of compiling old software to run on a new laptop on Windows 10.

I can compile the examples that come with Lazarus, but when I try to compile my own test program I get the error message in the attached image.

My steps were:
Create project from file (I chose an example file from the openal fpc examples folder because my old programs use it) and chose the option 'Program' for type of project
Save the project
Press Run and I get the error message:

captureplaybackopenal.pas(5,13) Fatal: Cannot find openal used by captureplaybackopenal of the Project Inspector.

I'm certain the paths are set correctly?
However if I copy the openal src over to my project folder it compiles and works.

Can someone help me to get this set up correctly?

Thanks in advance

Albert

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 935
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #1 on: November 20, 2021, 10:33:15 pm »
Add the -vtu command line option. That will make the compiler print all tried units in all directories, and why they were accepted/rejected.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3658
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #2 on: November 20, 2021, 10:51:16 pm »
Jonas, where should he be doing that: Project Inspector -> Compiler Options -> Custom Options?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

acp693

  • Jr. Member
  • **
  • Posts: 73
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #3 on: November 20, 2021, 11:00:55 pm »
Thanks to both of you. I checked the boxes for 'Show used Files(-vu)' and 'Show tried files(-vt)' under Project Option->Compiler Options ->Verbosity, But I get no additional messages when I compile the project.  still get the same error message. Where would this additional info appear? In the messages box?

Thanks again

Albert

howardpc

  • Hero Member
  • *****
  • Posts: 3856
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #4 on: November 20, 2021, 11:10:24 pm »
Where would this additional info appear? In the messages box?

Right-click on any message in Messages,
choose "Filter non urgent Messages",
then "Filter None, do not filter by urgency"
When you next compile you should see all messages, none will be filtered out.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3658
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #5 on: November 20, 2021, 11:15:09 pm »
I am /really/ not sure about this, but I suspect that those options control what is considered permissible output (i.e. a filter) rather than what's generated by the compiler. That's why I asked Jonas (core team) to confirm.

I'd expect it to come up in the messages box, but also keep an eye on console output.. or whatever it's called under Windows. Try adding -vtu (Jonas's suggestion) in the project options.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

acp693

  • Jr. Member
  • **
  • Posts: 73
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #6 on: November 20, 2021, 11:37:49 pm »
Thanks Howard, that produced many more messages. It seems the compiler isn't searching under 'source' even though it's in the path. It looks in bin and units, but not source...

I had to cut some of the messages because I hit the 20000 character limit

What to do next? Thanks for all the help so far!

Albert

Compile Project, Target: captureplaybackopenal.exe: Exit code 1, Errors: 1, Hints: 2
Debug: Configfile search: fpc.cfg
Debug: Configfile search: C:\Users\PiaAlbert\fpc.cfg
Debug: Configfile search: C:\ProgramData\fpc.cfg
Debug: Configfile search: C:\lazarus\fpc\3.2.0\bin\x86_64-win64\fpc.cfg
Verbose: Reading options from file C:\lazarus\fpc\3.2.0\bin\x86_64-win64\fpc.cfg
Hint: Start of reading config file C:\lazarus\fpc\3.2.0\bin\x86_64-win64\fpc.cfg
Debug: Path "C:\Users\PiaAlbert\AppData\Local\FreePascal\fppkg\units\x86_64-win64\*\" not found
Debug: Path "C:\lazarus\fpc\3.2.0\lib\x86_64-win64\" not found
Hint: End of reading config file C:\lazarus\fpc\3.2.0\bin\x86_64-win64\fpc.cfg
Verbose: Free Pascal Compiler version 3.2.0 [2021/02/21] for x86_64
Verbose: Copyright (c) 1993-2020 by Florian Klaempfl and others
Verbose: Compiler: C:\lazarus\fpc\3.2.0\bin\x86_64-win64\ppcx64.exe
Verbose: Target OS: Win64 for x64
Verbose: Using executable path: C:\lazarus\fpc\3.2.0\bin\x86_64-win64\
Verbose: Using unit path: .\

Verbose: Compiling captureplaybackopenal.pas
Debug: Searching file captureplaybackopenal.pas... found
Debug: (CAPTUREPLAYBACKOPENAL) (10057) Registering new unit SYSTEM
Debug: (CAPTUREPLAYBACKOPENAL) (10027) Load from CAPTUREPLAYBACKOPENAL (implementation) unit SYSTEM
Debug: (SYSTEM)   (10055) Loading unit SYSTEM
Verbose: Unitsearch: system.ppu
Verbose: Unitsearch: D:\Albert\Lazarus\test\lib\x86_64-win64\system.ppu
Verbose: Unitsearch: system.pp
Verbose: Unitsearch: system.pas
Verbose: Unitsearch: system.ppu
Verbose: Unitsearch: system.pp
Verbose: Unitsearch: system.pas
Verbose: Unitsearch: C:\lazarus\fpc\3.2.0\units\x86_64-win64\httpd22\system.ppu
Verbose: Unitsearch: C:\lazarus\fpc\3.2.0\units\x86_64-win64\httpd22\system.pp

Verbose: Unitsearch: C:\lazarus\fpc\3.2.0\units\x86_64-win64\openal.pp
Verbose: Unitsearch: C:\lazarus\fpc\3.2.0\units\x86_64-win64\openal.pas
Verbose: Unitsearch: C:\lazarus\fpc\3.2.0\bin\x86_64-win64\openal.pp
Verbose: Unitsearch: C:\lazarus\fpc\3.2.0\bin\x86_64-win64\openal.pas
captureplaybackopenal.pas(5,14) Fatal: Cannot find openal used by captureplaybackopenal of the Project Inspector.
Verbose: Compilation aborted
Verbose: C:\lazarus\fpc\3.2.0\bin\x86_64-win64\ppcx64.exe returned an error exitcode

acp693

  • Jr. Member
  • **
  • Posts: 73
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #7 on: November 20, 2021, 11:59:54 pm »
I'm also getting lots of PPU messages like this:

Debug: (SYSTEM)   (10011) PPU Source: system.pp not available

acp693

  • Jr. Member
  • **
  • Posts: 73
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #8 on: November 21, 2021, 10:00:10 am »
I've tried a complete re-install after totally removing all traces of Lazarus. I've tried the latest release candidate. I've tried installing with the 'second version of lazarus' checkbox checked so that brand new config files are created and not inadvertently using some old file (though I'm sure it's not). The same project compiles on my old XP windows machine with an old version of Lazarus. The fpc source files are in the same place as on my new machine, just different versions...

I'm really at a loss what to do now. The only work around seems to be to copy the fpc files needed for any project to the project folder. The fpc files are just not been found, even though the fpc source files path is correct in Lazarus settings..

If anyone can provide further help to get this working I would be very grateful.

Albert

wp

  • Hero Member
  • *****
  • Posts: 9157
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #9 on: November 21, 2021, 10:21:05 am »
I tried your example (CaptureAndPlayback in fpc's openal/examples folder) with Laz 2.2RC2/FPC2.2.2/64-bit on Windows and can confirm your observation. I seems to me that openal is not included in the FCL by default.

As a workaround, I opened the project options, "Compiler Options" > "Paths" > "Other units", clicked '...' and added the openal/src directory to the path (i.e. the "Other units" box must list "..\src"). Now compilation works. At runtime, however, the programs stops with an exception - maybe because I don't know what this program is doing and I dont have the dlls/hardware needed.
« Last Edit: November 21, 2021, 10:28:21 am by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

acp693

  • Jr. Member
  • **
  • Posts: 73
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #10 on: November 21, 2021, 10:35:37 am »
Thanks for trying that. That works for me too. The program accesses the soundcard, records 5 seconds of audio and then plays it back.

If openal src isn't been found then probably anything else under C:\lazarus\fpc\3.2.2\Source won't be found either. What's the point of the fpc source folder path setting if the compiler doesn't look in there?

Thanks

Albert




MarkMLl

  • Hero Member
  • *****
  • Posts: 3658
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #11 on: November 21, 2021, 11:01:13 am »
If openal src isn't been found then probably anything else under C:\lazarus\fpc\3.2.2\Source won't be found either. What's the point of the fpc source folder path setting if the compiler doesn't look in there?

I believe he's saying that it's not /built/ as part of the FCL by default. The purpose of the source folder setting is so that a debugger etc. knows where to look, not necessarily to enable build-on-demand.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

acp693

  • Jr. Member
  • **
  • Posts: 73
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #12 on: November 21, 2021, 11:12:09 am »
Mark, thank you. Do you have an idea why the project compiles on my old XP machine with an older version of Lazarus(Lazarus 1.0.14, fpc2.6.2) without specifying the openal src under 'Other sources' in Project settings?
« Last Edit: November 21, 2021, 11:14:00 am by acp693 »

MarkMLl

  • Hero Member
  • *****
  • Posts: 3658
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #13 on: November 21, 2021, 11:24:51 am »
"Not knowing, can't say" but it's not unprecedented for a package to be removed from the FCL or RTL because there was a temporary build problem and nobody remembers to put it back.

Note that I'm not one of the core team, so am quite likely to be corrected.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9769
  • FPC developer.
Re: Lazarus doesn't find FPC unit even though path is correct
« Reply #14 on: November 21, 2021, 12:00:40 pm »
First: the entry in the dialog that you show (the fpc sources) does not constitute a FPC search path, this setting is for the IDE's codetools and the debugger's benefit

Second, you seem to compile for 64-bit Windows and Openal seems to be default not compiled for win64, change your target to i386-win32 and it will probably work, as probably 10 years ago.

Headers are usually only enabled for targets where they have been confirmed to work.
« Last Edit: November 21, 2021, 12:21:25 pm by marcov »

 

TinyPortal © 2005-2018