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

v0.21.0 fails to compile due to missing header #1173

Closed
ThePyrotechnic opened this issue May 10, 2024 · 1 comment · Fixed by #1176 or #1183
Closed

v0.21.0 fails to compile due to missing header #1173

ThePyrotechnic opened this issue May 10, 2024 · 1 comment · Fixed by #1176 or #1183

Comments

@ThePyrotechnic
Copy link

When compiling v0.21.0 on an up-to-date x86 Arch Linux PC, I receive the following error:
(I have also observed this on the master branch as of 919f06e)

[ 50%] Building CXX object CMakeFiles/datachannel.dir/src/nalunit.cpp.o
<truncated>/libdatachannel/src/h264rtpdepacketizer.cpp: In member function ‘virtual void rtc::H264RtpDepacketizer::incoming(rtc::message_vector&, const rtc::message_callback&)’:
<truncated>/libdatachannel/src/h264rtpdepacketizer.cpp:116:29: error: ‘remove_if’ is not a member of ‘std’; did you mean ‘remove_cv’?
  116 |         messages.erase(std::remove_if(messages.begin(), messages.end(),
      |                             ^~~~~~~~~
      |                             remove_cv
make[2]: *** [CMakeFiles/datachannel.dir/build.make:328: CMakeFiles/datachannel.dir/src/h264rtpdepacketizer.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:355: CMakeFiles/datachannel.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

From cppreference it seems that remove_if requires the <algorithm> header to be imported
I've attached the following patch that I used to test (below), but I'm not sure if this is the best place for the include since I am not familiar with the project.
0001-Include-algorithm-to-use-std-remove_if.patch.txt

@paullouisageneau
Copy link
Owner

Thank you for reporting, this is fixed in #1176. Your patch is fine but I prefer headers needed only by the implementation to be imported in the .cpp file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants