Recent

Author Topic: Build IDE Error: Compiler /usr/bin/fpc.exe not found  (Read 2254 times)

fournoas

  • New Member
  • *
  • Posts: 11
Build IDE Error: Compiler /usr/bin/fpc.exe not found
« on: January 23, 2024, 10:46:03 am »
I installed Lazarus in WSL (Windows Subsystem for Linux) and ran it successfully. However, the following error occurred when building the IDE:

Quote
Makefile(135,0) Error: linker:*** Compiler /usr/bin/fpc.exe not found. Stop.

I'm not sure if this is because the running environment is WSL.

I fixed this by creating an "fpc.exe" file:

Quote
sudo ln -s /usr/bin/fpc /usr/bin/fpc.exe

I'm not sure if this is a BUG or not.

Environment:
  • WSL2 + Ubuntu 20.04 LTS
  • Lazarus 3.0.0 + FPC 3.2.2
« Last Edit: January 23, 2024, 10:58:38 am by fournoas »

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Build IDE Error: Compiler /usr/bin/fpc.exe not found
« Reply #1 on: January 23, 2024, 10:55:53 am »
I'm not sure if this is a BUG or not.
And imho neither does make and/or the makefile.

afaik (I do not use WSL or have any experience with it) WSL is a seamless integration of Linux in/to your Windows desktop. So you start the (Linux) IDE in Windows, appearing as a windows application. Then you rebuild your IDE, which technically is done in Linux. Though you (still) run on Windows. Which make command is invoked (Windows .exe or Linux executable) ? So what does make think it is running on ?
Today is tomorrow's yesterday.

fournoas

  • New Member
  • *
  • Posts: 11
Re: Build IDE Error: Compiler /usr/bin/fpc.exe not found
« Reply #2 on: January 23, 2024, 11:23:22 am »
I'm not sure if this is a BUG or not.
And imho neither does make and/or the makefile.

afaik (I do not use WSL or have any experience with it) WSL is a seamless integration of Linux in/to your Windows desktop. So you start the (Linux) IDE in Windows, appearing as a windows application. Then you rebuild your IDE, which technically is done in Linux. Though you (still) run on Windows. Which make command is invoked (Windows .exe or Linux executable) ? So what does make think it is running on ?

WSL2 is essentially a Linux system running in a Microsoft Hyper-V virtual machine.
I installed the Linux version of Lazarus (lazarus-project_3.0.0-0_amd64.deb) and used XServer to display the Lazarus GUI in Windows desktop. Technically this should be a complete Linux(Ubuntu 20.04 LTS) environment.
I tried to rebuild the IDE in the main menu "Tools"-"Build Lazarus with Profile: XXXX", then the error occurred.
I didn't find which Makefile caused the problem

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Build IDE Error: Compiler /usr/bin/fpc.exe not found
« Reply #3 on: January 23, 2024, 11:32:55 am »
@fournoas:
It is not about which makefile causes the error (they all will) it is about using WSL (similar as using Wine on Linux) and its configuration that allows (forces ?) to let Windows execute the make command regardless whether or not it is a Windows .exe or a Linux executable.

First come, first serve and I assume you do not have your Linux paths take precedence in your path environment variable (for Wine it is exactly the other way around  :) ).
« Last Edit: January 23, 2024, 11:39:28 am by TRon »
Today is tomorrow's yesterday.

fournoas

  • New Member
  • *
  • Posts: 11
Re: Build IDE Error: Compiler /usr/bin/fpc.exe not found
« Reply #4 on: January 23, 2024, 11:44:22 am »
I see...
I tested with "which make" command in WSL2 and the result was "/usr/bin/make"

emmm, I think I'd better switch to a real Linux system, thank you

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Build IDE Error: Compiler /usr/bin/fpc.exe not found
« Reply #5 on: January 23, 2024, 11:54:30 am »
I tested with "which make" command in WSL2 and the result was "/usr/bin/make"
WSL should report that back when executed in its own environment but apparantly it does not seem to do so when the make command is executed the way it is executed (the build system does not use hardcoded paths)

Quote
emmm, I think I'd better switch to a real Linux system, thank you
That is a decision you would indeed have to consider yourself. If you are aware of the drawbacks then you can address them and it shouldn't be a (real) problem.

Personally I prefer to use a separate installation for foreign Operating Systems using a VM such as vbox/VMWare. That also is able to run seamless but not that seamless  :)

But do note, I do not have any experience with WSL itself so there might be a better solution to/for the issue that you are currently facing. Perhaps someone else is around that knows these things inside out and has a (simple) better idea.
Today is tomorrow's yesterday.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6381
  • Compiler Developer
Re: Build IDE Error: Compiler /usr/bin/fpc.exe not found
« Reply #6 on: January 23, 2024, 09:50:43 pm »
I'm not sure if this is because the running environment is WSL.

WSL also includes the Windows paths in its PATH environment variable. I usually do a export PATH=... with only the WSL internal paths before executing make.

fournoas

  • New Member
  • *
  • Posts: 11
Re: Build IDE Error: Compiler /usr/bin/fpc.exe not found
« Reply #7 on: January 24, 2024, 03:32:06 am »
I'm not sure if this is because the running environment is WSL.

WSL also includes the Windows paths in its PATH environment variable. I usually do a export PATH=... with only the WSL internal paths before executing make.

it works, thank you

Quote
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/snap/bin

 

TinyPortal © 2005-2018