Compilation error on example "multiple"

Đang mở Phù hợp với người mới
#425 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
cmake, cpp
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu trong examples/CMakeLists.txt, tại khai báo add_executable của ví dụ multiple, và tái hiện lỗi bằng các lệnh cmake và make được ghi trong tài liệu. Kiểm tra cách tên target xung đột với thư mục mã nguồn multiple, sau đó thực hiện thay đổi nhỏ nhất về tên hoặc cấu hình để tránh xung đột. Hoàn tất khi ví dụ multiple liên kết thành công và quá trình build hoàn thành.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi,

Running on linux ubuntu 25.10

This is my first contact with the project, so I might have made some mistake.

Went through the short procedure for testing the install.

git clone https://github.com/RobLoach/raylib-cpp.git
cd raylib-cpp
mkdir build
cd build
cmake ..
make

Couldn't get further as the build failed on the multiple example link, with the error:

[ 95%] Linking CXX executable multiple
/usr/bin/ld: cannot open output file multiple: est un dossier

"output file multiple: est un dossier" translates to something like "output file multiple: is a directory"

Went to examples/CMakeLists.txt, which on lines 57-59 reads like:

# Multiple Files Example
add_executable("multiple" multiple/main.cpp multiple/Player.cpp)
target_link_libraries("multiple" PUBLIC raylib_cpp raylib)

This creates a multiple executable file in the examples/CMakeFiles/multiple.dir/ which already contains a multiple directory for the generated objects, hence the conflict.

Not being a cmake expert, I've had hard times finding how to resolve the problem except by changing one of the names involved, meaning, either the source directory name or target executable.

Being lazy straight, I changed the executable target name to mooltiple (in reference to the mooltipass https://www.youtube.com/watch?v=yQMpfII_Jjw).

Not being an expert, I can't exactly tell if I've been just doing things wrong from the start, and I guess there might be a better solution (or name at least), but made it work for me. Not feeling confident enough to make a PR though. So just let you know, in case there is a real problem and you have a better idea.

Anyway, thanks for the project, this is cool :)

Ngôn ngữ chính
C++
Star
960
Fork
120
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RobLoach/raylib-cpp

Tất cả issue của RobLoach/raylib-cpp

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.