RobLoach / RobLoach/raylib-cpp
Compilation error on example "multiple"
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 960
- Forks
- 120
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
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 :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in examples/CMakeLists.txt at the multiple example's add_executable declaration and reproduce the failure with the documented cmake and make commands. Check how the target name conflicts with the multiple source directory, then make the smallest naming or configuration change that avoids the conflict. Done means the multiple example links successfully and the build completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100