Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch compile error "copy_n is not a member of 'std';" #326

Closed
redracerTURBO opened this issue May 24, 2024 · 3 comments
Closed

Arch compile error "copy_n is not a member of 'std';" #326

redracerTURBO opened this issue May 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@redracerTURBO
Copy link
Contributor

redracerTURBO commented May 24, 2024

Fill out general information
OS: Arch Linux
BeamMP-Server Version: v3.5.0

Describe the bug
When compiling, this error occurs:
/home/username/BeamMP-Server/include/Common.h:312:10: error: ‘copy_n’ is not a member of ‘std’; did you mean ‘copy’?
Compilation does not complete.

To Reproduce
Steps to reproduce the behavior:
Follow the "Build from Source" instructions in README.md

Expected behavior
Compile finishes

Logs
output of "cmake --build bin --parallel --config Release -t BeamMP-Server -v |& tee build_error.log"
build_error.log

Additional context
gcc (GCC) 14.1.1 20240507
cmake version 3.29.3

I believe the solution is to add:

#include <algorithm>

to the include section of include/Common.h. I was able to successfully compile on my system with this addition. This addition is technically necessary since the algorithm header is where copy_n is defined, but on many systems it gets included from another header file.

@redracerTURBO redracerTURBO added the bug Something isn't working label May 24, 2024
@lionkor
Copy link
Contributor

lionkor commented May 24, 2024

Wow, yeah, I had the same thing today. I mainly develop on arch as well, unsure when and where that passed review(?)

If you are interested in making a PR with your fix, I'd be happy to merge that. If not, I'll fix it.

@redracerTURBO
Copy link
Contributor Author

I'd love to fix it myself, I'm very new to github haha. Glad to have the learning experience!

@lionkor
Copy link
Contributor

lionkor commented May 24, 2024

Awesome! You usually

  1. make a fork
  2. make the change you want, in the fork
  3. make a pull request

Good luck and feel free to ask if anything is unclear.

lionkor added a commit that referenced this issue May 24, 2024
added ```#include <algorithm>``` to Common.h, needed for "copy_n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants