Closed helywin closed 7 months ago
Describe the bug usrsctp lib has no cmake file to import itself as Usrsctp::Usrsctp
Environment
To Reproduce Steps to reproduce the behavior:
use this code to reproduce
project(voice_intercom) cmake_minimum_required(VERSION 2.8) set(CMAKE_CXX_STANDARD 17) find_package(LibDataChannel CONFIG REQUIRED) add_executable(robot_voice main.cpp) target_link_libraries(robot_voice LibDataChannel::LibDataChannelStatic dl )
// main.cpp #include <rtc/rtc.hpp> #define SAMPLE_RATE 48000 #define CHANNELS 2 #define FRAME_SIZE 960 #define BITRATE 64000 int main(int argc, char *argv[]) { rtc::Configuration config; rtc::PeerConnection pc(config); std::shared_ptr<rtc::DataChannel> dc = pc.createDataChannel("audio"); float input[FRAME_SIZE * CHANNELS]; unsigned char encodedData[FRAME_SIZE * CHANNELS * 2]; std::size_t encodedLength = 0; while (true) { dc->send((std::byte *)encodedData, encodedLength); } }
Expected behavior no compile error
Failure logs compile error
/usr/bin/ld: cannot find -lUsrsctp::Usrsctp collect2: error: ld returned 1 exit status
Additional context
I modified vcpkg/installed/x64-linux/share/LibDataChannel/LibDataChannelTargets.cmake line 63 as below and solve the problem
vcpkg/installed/x64-linux/share/LibDataChannel/LibDataChannelTargets.cmake
- INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:Usrsctp::Usrsctp>;\$<LINK_ONLY:plog::plog>;\$<LINK_ONLY:OpenSSL::SSL>;\$<LINK_ONLY:LibJuice::LibJuice>" + INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:usrsctp>;\$<LINK_ONLY:plog::plog>;\$<LINK_ONLY:OpenSSL::SSL>;\$<LINK_ONLY:LibJuice::LibJuice>"
Fixing by #35618.
@MonicaLiu0311 @jimwang118 I think this can be closed now?
@MonicaLiu0311 it broken the build on ubuntu. please reopen
An emerging issue has been reported in #36177.
Edit: Fixed by #36191.
Describe the bug usrsctp lib has no cmake file to import itself as Usrsctp::Usrsctp
Environment
To Reproduce Steps to reproduce the behavior:
use this code to reproduce
Expected behavior no compile error
Failure logs compile error
Additional context
I modified
vcpkg/installed/x64-linux/share/LibDataChannel/LibDataChannelTargets.cmake
line 63 as below and solve the problem