Skip to content

Failing to find -lglfw on x86_64-unknown-linux-gnu because of wrong name/path #36

@TrevorCow

Description

@TrevorCow

When trying to compile glfw (and thus glfw-sys) with the src-build flag on x86_64-unknown-linux-gnu, it fails to build the project with a linking error:
rust-lld: error: unable to find library -lglfw.

I found 2 problems with the build script that fixed it for me and could submit a pull request but I don't know if this is the "correct" way.

The 2 problems:

  1. It is searching for glfw when the built binary file is glfw3 (glfw-sys/out/lib64/libglfw3.a)
  2. It adds the search path [PROJECT_DIR]/target/debug/build/glfw-sys-HASH/out/lib instead of .../lib64

Changing the build script to on line 67 to output the correct library name glfw3 and line 257 from lib to lib64 fixed the linking errors for me.

So I guess the only question I have is when does glfw output to lib64 rather than lib (Maybe on 32 bit? Or if it even does anymore, this may just be left over) and is the output name ever just libglfw.a or is it always now libglfw3.a?

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