yanhua133 / mediasoup-sfu-cpp

webrtc c++ library for mediasoup with full sfu c++ demo
Apache License 2.0
161 stars 45 forks source link

编译问题centos8 #1

Closed mingyang0921 closed 2 years ago

mingyang0921 commented 2 years ago

[ 23%] Built target libwebrtc [ 83%] Built target worker [ 94%] Built target mediasoup [ 95%] Linking CXX executable ../sfu-demo ../../release/lib/liboatpp-websocket.a(Handshaker.cpp.o): In function oatpp::websocket::Handshaker::serversideHandshake(oatpp::data::share::LazyStringMapTemplate<oatpp::data::share::StringKeyLabelCI_FAST, std::multimap<oatpp::data::share::StringKeyLabelCI_FAST, oatpp::data::share::StringKeyLabel, std::less<oatpp::data::share::StringKeyLabelCI_FAST>, std::allocator<std::pair<oatpp::data::share::StringKeyLabelCI_FAST const, oatpp::data::share::StringKeyLabel> > > > const&, std::shared_ptr<oatpp::network::ConnectionHandler> const&)': Handshaker.cpp:(.text+0x31e): undefined reference tooatpp::encoding::Base64::ALPHABET_BASE64' Handshaker.cpp:(.text+0x353): undefined reference to oatpp::encoding::Base64::encode(oatpp::data::mapping::type::String const&, char const*)' ../../release/lib/liboatpp-websocket.a(Handshaker.cpp.o): In functionoatpp::websocket::Handshaker::clientsideConfirmHandshake(oatpp::data::share::LazyStringMapTemplate<oatpp::data::share::StringKeyLabelCI_FAST, std::multimap<oatpp::data::share::StringKeyLabelCI_FAST, oatpp::data::share::StringKeyLabel, std::less, std::allocator<std::pair<oatpp::data::share::StringKeyLabelCI_FAST const, oatpp::data::share::StringKeyLabel> > > > const&, std::shared_ptr const&)': Handshaker.cpp:(.text+0xbdf): undefined reference to oatpp::web::protocol::http::incoming::Response::getStatusCode() const' Handshaker.cpp:(.text+0xc04): undefined reference tooatpp::web::protocol::http::incoming::Response::getHeaders() const' Handshaker.cpp:(.text+0xe3a): undefined reference to oatpp::encoding::Base64::ALPHABET_BASE64' Handshaker.cpp:(.text+0xe69): undefined reference tooatpp::encoding::Base64::encode(oatpp::data::mapping::type::String const&, char const)' ../../release/lib/liboatpp-websocket.a(Utils.cpp.o): In function oatpp::websocket::Utils::generateMaskForFrame(oatpp::websocket::Frame::Header&)': Utils.cpp:(.text+0x33): undefined reference tooatpp::utils::random::Random::randomBytes(unsigned char, long)' ../../release/lib/liboatpp-websocket.a(Utils.cpp.o): In function oatpp::websocket::Utils::generateKey()': Utils.cpp:(.text+0x8a): undefined reference tooatpp::utils::random::Random::randomBytes(unsigned char, long)' Utils.cpp:(.text+0x91): undefined reference to oatpp::encoding::Base64::ALPHABET_BASE64' Utils.cpp:(.text+0xa4): undefined reference tooatpp::encoding::Base64::encode(oatpp::data::mapping::type::String const&, char const)' collect2: error: ld returned 1 exit status make[2]: [demo/CMakeFiles/sfu-demo.dir/build.make:272: sfu-demo] Error 1 make[1]: [CMakeFiles/Makefile2:232: demo/CMakeFiles/sfu-demo.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

oatpp相关的三个库都成功编译了。生成了.a。不知道为什么显示undefined

mingyang0921 commented 2 years ago

/usr/bin/c++ -std=c++11 -std=c++11 -pthread -g -gdwarf-2 -Wall -Wendif-labels -W -Wno-unused-parameter -Wall -Wextra -Wno-unused-parameter -std=c++11 -fPI C CMakeFiles/sfu-demo.dir/main.cpp.o CMakeFiles/sfu-demo.dir/Server.cpp.o CMakeFiles/sfu-demo.dir/Config.cpp.o CMakeFiles/sfu-demo.dir/Transfmt.cpp.o CMakeFi les/sfu-demo.dir/rooms/Lobby.cpp.o CMakeFiles/sfu-demo.dir/rooms/Message.cpp.o CMakeFiles/sfu-demo.dir/rooms/Peer.cpp.o CMakeFiles/sfu-demo.dir/rooms/Room.cp p.o CMakeFiles/sfu-demo.dir/utils/Statistics.cpp.o CMakeFiles/sfu-demo.dir/utils/util.cpp.o -o ../sfu-demo ../libworker.a ../liblibwebrtc.a ../../release/li b/liboatpp-websocket.a ../../release/lib/liboatpp.a ../../release/lib/liboatpp-openssl.a ../../release/lib/libnetstring.a ../../release/lib/libuv_a.a ../../ release/lib/libssl.a ../../release/lib/libcrypto.a ../../release/lib/libsrtp2.a ../../release/lib/libusrsctp.a ../../release/lib/libabsl_internal_throw_deleg ate.a ../../release/lib/libabsl_strings.a ../../release/lib/libabsl_optional.a ../../release/lib/libabsl_bad_optional_access.a ../../release/lib/libabslbad variant_access.a ../../release/lib/libabsl_internal_bad_any_cast_impl.a -ldl ../../release/lib/libsdptransform.a ../libmediasoup.a ../../release/lib/libuv_a. a ../../release/lib/libssl.a ../../release/lib/libcrypto.a ../../release/lib/libsrtp2.a ../../release/lib/libusrsctp.a ../../release/lib/libabsl_internal_thr ow_delegate.a ../../release/lib/libabsl_strings.a ../../release/lib/libabsl_optional.a ../../release/lib/libabsl_bad_optional_access.a ../../release/lib/liba bsl_bad_variant_access.a ../../release/lib/libabsl_internal_bad_any_cast_impl.a -ldl ../../release/lib/libsdptransform.a

把liboatpp-websocket.a放到liboatpp.a前面就可以了