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

fatal error: 'absl/types/optional.h' file not found #109

Open
jeckymodi opened this issue Aug 30, 2021 · 3 comments
Open

fatal error: 'absl/types/optional.h' file not found #109

jeckymodi opened this issue Aug 30, 2021 · 3 comments

Comments

@jeckymodi
Copy link

I had followed documentation for installation of Mediasoup ios.

https://github.com/ethand91/mediasoup-ios-client/blob/master/documentation/Installation.md

I had followed following commands to create .a framework of mediasoup but I am getting error like fatal error: 'absl/types/optional.h' file not found

cd /Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies
jitendra@Aub-17-Saurav-Mac-mini dependencies % cmake . -Bbuild -DLIBWEBRTC_INCLUDE_PATH=/Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src -DLIBWEBRTC_BINARY_PATH=/Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src/out_ios_libs/universal -DMEDIASOUP_LOG_DEV=ON -DCMAKE_CXX_FLAGS="-fvisibility=hidden" -DLIBSDPTRANSFORM_BUILD_TESTS=OFF -DIOS_SDK=iphone -DIOS_ARCHS="arm64"

This is the output for above command

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 
========== libmediasoupclient iOS Build Configuration ==========

-- CMAKE_OSX_SYSROOT             = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/
-- CMAKE_OSX_ARCHITECTURES       = arm64

=========== libmediasoupclient Build Configuration ===========

-- MEDIASOUPCLIENT_BUILD_TESTS : OFF
-- MEDIASOUPCLIENT_LOG_TRACE   : OFF
-- MEDIASOUPCLIENT_LOG_DEV     : OFF
-- LIBWEBRTC_INCLUDE_PATH      : /Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src
-- LIBWEBRTC_BINARY_PATH       : /Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src/out_ios_libs/universal

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    MEDIASOUP_LOG_DEV


-- Build files have been written to: /Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/build

After that I tried to fire this command

make -C build

I am getting following error.


[  4%] Building CXX object libmediasoupclient/libsdptransform/CMakeFiles/sdptransform.dir/src/grammar.cpp.o
clang: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Wincompatible-sysroot]
[  8%] Building CXX object libmediasoupclient/libsdptransform/CMakeFiles/sdptransform.dir/src/parser.cpp.o
clang: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Wincompatible-sysroot]
[ 12%] Building CXX object libmediasoupclient/libsdptransform/CMakeFiles/sdptransform.dir/src/writer.cpp.o
clang: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Wincompatible-sysroot]
[ 16%] Linking CXX static library libsdptransform.a
[ 16%] Built target sdptransform
[ 20%] Building CXX object libmediasoupclient/CMakeFiles/mediasoupclient.dir/src/Consumer.cpp.o
clang: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Wincompatible-sysroot]
In file included from /Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/libmediasoupclient/src/Consumer.cpp:3:
In file included from /Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/libmediasoupclient/include/Consumer.hpp:5:
/Users/jitendra/Documents/Projects/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src/api/media_stream_interface.h:24:10: fatal error: 'absl/types/optional.h' file not found
#include "absl/types/optional.h"
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [libmediasoupclient/CMakeFiles/mediasoupclient.dir/src/Consumer.cpp.o] Error 1
make[1]: *** [libmediasoupclient/CMakeFiles/mediasoupclient.dir/all] Error 2
make: *** [all] Error 2

Any help would be appereciated.

@mythkiven
Copy link

I have the same problem

@jeckymodi
Copy link
Author

I resolve this issue by adding that dependency but now I got new error as I posted after this issue.

@foxchen2000
Copy link

Copying webrtc/src/third_party to the destination folder solves the problem.

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

No branches or pull requests

3 participants