Skip to content

[Raylib] build failure , linker issue glfw #22932

@silent1603

Description

@silent1603

Host Environment

  • OS: Linux
  • Compiler: gcc 9.4.0

To Reproduce
Steps to reproduce the behavior:

  • i use vcpkg as a Submodule, here is vcpkg.json :

{
"name": "tinyraylib",
"version-string": "0.1.0",
"dependencies": [
{
"name" : "raylib",
"features" : ["use-audio","hidpi"]
},
"spdlog",
"glfw3"
]
}

in cmake file:

find_package(raylib CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
...

target_link_libraries(TinyRaylib PRIVATE glfw
PRIVATE spdlog::spdlog spdlog::spdlog_header_only
PRIVATE raylib
)

Failure logs

-- Running vcpkg install
-- Running vcpkg install - done
-- Submodule update
-- Configuring done
-- Generating done
-- Build files have been written to: /media/silent/00ae94e9-5f5d-4c69-83b9-ef5758ebf1ae/Project/TinyRaylib/build
[ 50%] Linking CXX executable ../release/TinyRaylib
/usr/bin/ld: cannot find -lglfw
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/TinyRaylib.dir/build.make:95: ../release/TinyRaylib] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/TinyRaylib.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

in vcpkg-manifest-install.log in build folder


The package glfw3 provides CMake targets:
 
  find_package(glfw3 CONFIG REQUIRED)
  target_link_libraries(main PRIVATE glfw)

The package raylib provides CMake targets:
 
     find_package(raylib CONFIG REQUIRED)
     target_link_libraries(main PRIVATE raylib)
 
 The package spdlog provides CMake targets:

    find_package(spdlog CONFIG REQUIRED)
   target_link_libraries(main PRIVATE spdlog::spdlog spdlog::spdlog_header_only)

I tried adding package glfw3 in vcpkg or in package manager but it didn't work.

Additional context

Metadata

Metadata

Assignees

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions