Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cannot find -llibgit2package when build examples #6241

Closed
@lucasoshiro

Description

@lucasoshiro

Hi!

In the current main branch (commit 2a0d0bd), I was trying to build the examples and then I got this error:

/usr/bin/ld: cannot find -llibgit2package: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/lg2.dir/build.make:545: lg2] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/lg2.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

After a bisect, I found that this was probably due to the change in 91ba089, in PR #6133. In the commit before the merge of that PR, it doesn't happen. I don't have knowledge in CMake, so I don't know how to solve this.

Reproduction steps

Building examples, from the project root:

mkdir examples/build
cd examples/build
cmake ..
cmake --build .

Expected behavior

Build the examples without errors, as in commit eca9e1c

Actual behavior

The ld error cannot find -llibgit2package: No such file or directory.

Version of libgit2 (release number or SHA1)

In Manjaro, 1.4.1-1. In Debian, 1.1.0+dfsg.1-4.

Operating system(s) tested

  • Manjaro 21.2.4

    • cmake 3.22.2
    • gcc 11.2.0
    • GNU Make 4.3
    • GNU ld 2.38
  • Debian 11 Bullseye (in a Docker container)

    • cmake 3.18
    • gcc 10.2.1
    • GNU make 4.3
    • GNU ld 2.35.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions