ianc
ianc

Reputation: 1

VS Code Omnipascal on xUbuntu 20.0.4 and FPC 3.2.0 compile error

I have a fresh installation of xubuntu vers. 20.0.4 I have installed Visual Studio Code vers. 1.64.0 I have installed: fpc-laz_3.2.0-1_amd64.deb fpc-src_3.2.0-1_amd64.deb lazarus-project_2.0.10-0_amd64.deb All installed correctly I opened a project in the Lazarus IDE called Project1, Compiled and ran the project The form was generated correctly. I installed the Omnipascal vers 0.19.0 extension in VS Code In Omnipascal settings in VS Code i have set

  1. Omnipascal to build scripts
  2. Default development environment: FreePascal
  3. Free Pascal Source Path: /usr/share/fpcsrc/3.2.0
  4. Lazbuild Path: /usr/share/lazarus/2.0.10/ide/ I have configured a build task
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "echo",
            "type": "shell",
            "command": "fpc",
            "args": [
                "${file}"
            ],
            "problemMatcher": [],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

When I open either the lpi project file or the unit1 pas file I get errors

Free Pascal Compiler version 3.2.0 [2020/07/07] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling /media/ian/vsts/laz/project1.lpr
project1.lpr(9,3) Fatal: Can't find unit Interfaces used by project1
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
The terminal process "/usr/bin/bash '-c', 'fpc /media/ian/vsts/laz/project1.lpr'" failed to launch (exit code: 1).

It looks like the interfaces.ppu and forms.ppu are not been found I searched for the files and added ther paths to: Omnipascal : Searchpath

To no avail

Question 1. Is this error a Visual Studio Error or a Free pascal compiler error Question 2. The Omnipascal installation instructions for Linux setting Lazbuild Path: requires a path to Lazbuild.exe. There is no such file in my installation. is this a Typo.

Any help will be greatfully received

Upvotes: 0

Views: 275

Answers (1)

Marco van de Voort
Marco van de Voort

Reputation: 26361

Lazarus adds configuration parameters (most notably, where lazarus files like "interfaces" are found) to the build.

While I don't vscode nor ominpascal, from your commandline I gather your omni solution does not.

Go into lazarus, load project, goto project -> project options -> show option to learn what is passed to the compiler. (note, some might be redundant and already in fpc.cfg).

Upvotes: 0

Related Questions