Endre
Endre

Reputation: 414

Swift Package Manager on Linux: dependency not recognised?

I am trying to use Swift for the 1st time on Linux and intend to create a small executable with SwiftImGui.

Here is my Package.swift:

// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "Impulse",
    dependencies: [
        .package(url: "https://github.com/ctreffs/SwiftImGui.git", from: "1.89.5"),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .executableTarget(
            name: "Impulse", dependencies: ["ImGui"]),
    ]
)

Unfortunately it doesn't build:

> swift build                                                                                                               
error: 'impulse': product 'ImGui' required by package 'impulse' target 'Impulse' not found.

What is wrong? Is there a fix for this?

Could it cause problem that SwiftImGui's tool version is older?: // swift-tools-version:5.3

Upvotes: 1

Views: 43

Answers (1)

Endre
Endre

Reputation: 414

This way the build process went forward:

...
        .executableTarget(
            name: "Impulse", dependencies: [.product(name: "ImGui", package: "SwiftImGui")]),
...

Upvotes: 0

Related Questions