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

fix build issue when configure --enable-testing #2948

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kageds
Copy link

@kageds kageds commented Apr 30, 2024

make fails when ./confgure --enable-testing

/home/build/srt_kageds/srtcore/group.cpp: In member function ‘void srt::StabilityTracer::create_file()’: /home/build/srt_kageds/srtcore/group.cpp:2577:46: error: no matching function for call to ‘std::basic_ofstream<char>::open(const string&, const openmode&)’ m_fout.open(fname, std::ofstream::out); ^ /home/build/srt_kageds/srtcore/group.cpp:2577:46: note: candidate is: In file included from /home/build/srt_kageds/srtcore/udt.h:86:0, from /home/build/srt_kageds/srtcore/api.h:60, from /home/build/srt_kageds/srtcore/group.cpp:5: /usr/include/c++/4.8.2/fstream:713:7: note: void std::basic_ofstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] open(const char* __s, ^ /usr/include/c++/4.8.2/fstream:713:7: note: no known conversion for argument 1 from ‘const string {aka const std::basic_string<char>}’ to ‘const char*’ make[2]: *** [CMakeFiles/srt_virtual.dir/srtcore/group.cpp.o] Error 1 make[1]: *** [CMakeFiles/srt_virtual.dir/all] Error 2 make: *** [all] Error 2

@ethouris
Copy link
Collaborator

Isn't it declared that if SRT_DEBUG_BONDING_STATES is enabled then C++11 is required?

@kageds
Copy link
Author

kageds commented Apr 30, 2024

I don't know, here is the output from my configure and make, maybe I'm doing something wrong:

 ./configure --enable-testing --enable-bonding --enforce-srt-debug-bonding-states
Running: cmake . -DENABLE_TESTING=1 -DENABLE_BONDING=1 -DENFORCE_SRT_DEBUG_BONDING_STATES=1
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /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: /bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /bin/pkg-config (found version "0.29.2")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- BUILD TYPE: Release
-- FORCED PP VARIABLE: SRT_DEBUG_BONDING_STATES=1
-- Performing Test HAVE_CLOCK_GETTIME_IN
-- Performing Test HAVE_CLOCK_GETTIME_IN - Success
-- CLOCK_MONOTONIC: available, no extra libs needed
-- LOGGING: ENABLED
-- USE_BUSY_WAITING: OFF (default)
-- No WITH_COMPILER_PREFIX - using C++ compiler /bin/c++
-- Looking for inet_pton
-- Looking for inet_pton - found
-- Checking for pthread_(g/s)etname_np in 'pthread_np.h':
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - not found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - not found
-- Checking for pthread_(g/s)etname_np in 'pthread.h':
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Checking for module 'openssl libcrypto'
--   Found openssl libcrypto, version 1.0.2k;1.0.2k
-- SSL via pkg-config: -L  -I  -l;ssl;crypto
-- ENCRYPTION: ENABLED, using: openssl libcrypto
-- SSL libraries: ssl;crypto
-- ENCRYPTION AEAD API: DISABLED
-- MAXREXMITBW API: DISABLED
-- COMPILER: GNU (/bin/c++) - GNU compat
-- NOTE: GCC 4.8.5 is detected with default C++98. Forcing C++11 on applications.
-- Looking for __atomic_fetch_add_8 in atomic
-- Looking for __atomic_fetch_add_8 in atomic - not found
-- Performing Test HAVE_LIBATOMIC_COMPILES
-- Performing Test HAVE_LIBATOMIC_COMPILES - Failed
-- Performing Test HAVE_GCCATOMIC_INTRINSICS
-- Performing Test HAVE_GCCATOMIC_INTRINSICS - Success
-- Performing Test HAVE_CXX_ATOMIC
-- Performing Test HAVE_CXX_ATOMIC - Success
-- Performing Test HAVE_CXX_ATOMIC_STATIC
-- Performing Test HAVE_CXX_ATOMIC_STATIC - Failed
-- Checking for C++ 'std::put_time()':
-- Performing Test HAVE_CXX_STD_PUT_TIME
-- Performing Test HAVE_CXX_STD_PUT_TIME - Failed
-- STDCXX_SYNC: OFF
-- MONOTONIC_CLOCK: ON
-- C++ STD: Forcing C++11 on applications
CMake Warning (dev) at CMakeLists.txt:713 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "GNU" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- DETECTED SYSTEM: LINUX;  LINUX=1
-- ENABLE_BONDING: ON
-- APP: srt_virtual: using default C++ standard
-- ADDING TRANSITIVE LINK DEP to:srt_shared : -lpthread
-- ADDING TRANSITIVE LINK DEP to:srt_static : -lpthread
-- INSTALL DIRS: bin=bin lib=lib64 shlib=lib64 include=include
-- APPS: ENABLED, std=11
-- C++ STD: srtsupport_virtual: forced C++11 standard - portable way
-- C++ STD: srt-live-transmit: forced C++11 standard - portable way
-- C++ STD: srt-file-transmit: forced C++11 standard - portable way
-- C++ STD: srt-tunnel: forced C++11 standard - portable way
-- DEVEL APPS (testing): ENABLED
-- C++ STD: utility-test: forced C++11 standard - portable way
-- C++ STD: uriparser-test: forced C++11 standard - portable way
-- C++ STD: srt-test-live: forced C++11 standard - portable way
-- C++ STD: srt-test-file: forced C++11 standard - portable way
-- C++ STD: srt-test-relay: forced C++11 standard - portable way
-- C++ STD: srt-test-multiplex: forced C++11 standard - portable way
-- C++ STD: srt-test-mpbond: forced C++11 standard - portable way
-- Configuring done
-- Generating done
-- Build files have been written to: /home/build/srt_kageds
make
[  1%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/api.cpp.o
[  2%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/buffer_snd.cpp.o
[  3%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/buffer_rcv.cpp.o
[  3%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/buffer_tools.cpp.o
[  4%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/cache.cpp.o
[  5%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/channel.cpp.o
[  6%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/common.cpp.o
[  7%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/core.cpp.o
[  8%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/crypto.cpp.o
[  9%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/epoll.cpp.o
[ 10%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/fec.cpp.o
[ 11%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/handshake.cpp.o
[ 12%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/list.cpp.o
[ 12%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/logger_default.cpp.o
[ 13%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/logger_defs.cpp.o
[ 14%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/logging.cpp.o
[ 15%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/md5.cpp.o
[ 16%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/packet.cpp.o
[ 17%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/packetfilter.cpp.o
[ 18%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/queue.cpp.o
[ 19%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/congctl.cpp.o
[ 20%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/socketconfig.cpp.o
[ 21%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/srt_c_api.cpp.o
[ 21%] Building C object CMakeFiles/srt_virtual.dir/srtcore/srt_compat.c.o
[ 22%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/strerror_defs.cpp.o
[ 23%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/sync.cpp.o
[ 24%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/tsbpd_time.cpp.o
[ 25%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/window.cpp.o
[ 26%] Building CXX object CMakeFiles/srt_virtual.dir/srtcore/group.cpp.o
/home/build/srt_kageds/srtcore/group.cpp: In member function ‘void srt::StabilityTracer::create_file()’:
/home/build/srt_kageds/srtcore/group.cpp:2577:46: error: no matching function for call to ‘std::basic_ofstream<char>::open(const string&, const openmode&)’
         m_fout.open(fname, std::ofstream::out);
                                              ^
/home/build/srt_kageds/srtcore/group.cpp:2577:46: note: candidate is:
In file included from /home/build/srt_kageds/srtcore/udt.h:86:0,
                 from /home/build/srt_kageds/srtcore/api.h:60,
                 from /home/build/srt_kageds/srtcore/group.cpp:5:
/usr/include/c++/4.8.2/fstream:713:7: note: void std::basic_ofstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
       open(const char* __s,
       ^
/usr/include/c++/4.8.2/fstream:713:7: note:   no known conversion for argument 1 from ‘const string {aka const std::basic_string<char>}’ to ‘const char*’
make[2]: *** [CMakeFiles/srt_virtual.dir/srtcore/group.cpp.o] Error 1
make[1]: *** [CMakeFiles/srt_virtual.dir/all] Error 2
make: *** [all] Error 2

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Apr 30, 2024
@maxsharabayko maxsharabayko added this to the v1.5.4 milestone Apr 30, 2024
@ethouris
Copy link
Collaborator

But that part of the code is blocked by a conditional macro, which is not enabled by default.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.25%. Comparing base (4f925fb) to head (fc7f930).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2948      +/-   ##
==========================================
+ Coverage   64.88%   65.25%   +0.37%     
==========================================
  Files         101      101              
  Lines       17634    17634              
==========================================
+ Hits        11441    11507      +66     
+ Misses       6193     6127      -66     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants