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

[Bug]: GCC 7.5.0, build abseil-cpp-20240722.0.tar.gz, found error when make #1803

Open
wangxiaokun opened this issue Jan 8, 2025 · 0 comments

Comments

@wangxiaokun
Copy link

Describe the issue

I hoped to compile successfully, but it actually failed.
I have saved the steps to compile Googletest and Abseil in a file, and you can review them.
mycompile.log

[ 80%] Building CXX object absl/strings/CMakeFiles/absl_string_view_test.dir/string_view_test.cc.o
cd /tmp/abseil-cpp-20240722.0/build/absl/strings && /usr/local/gcc-7.5.0/bin/g++ -I/tmp/abseil-cpp-20240722.0 -I/googletest/include -I/googlemock/include -isystem /app/caih/workspace/CSMS/00_public/package/googletest-1.15.2/build/include -std=gnu++1z -Wall -Wextra -Wcast-qual -Wconversion-null -Wformat-security -Wnon-virtual-dtor -Woverlength-strings -Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -DNOMINMAX -Wno-deprecated-declarations -Wno-missing-declarations -Wno-self-move -Wno-sign-compare -Wno-unused-function -Wno-unused-parameter -Wno-unused-private-field -MD -MT absl/strings/CMakeFiles/absl_string_view_test.dir/string_view_test.cc.o -MF CMakeFiles/absl_string_view_test.dir/string_view_test.cc.o.d -o CMakeFiles/absl_string_view_test.dir/string_view_test.cc.o -c /tmp/abseil-cpp-20240722.0/absl/strings/string_view_test.cc
In file included from /app/caih/workspace/CSMS/00_public/package/googletest-1.15.2/build/include/gtest/gtest.h:71:0,
from /tmp/abseil-cpp-20240722.0/absl/strings/string_view_test.cc:33:
/tmp/abseil-cpp-20240722.0/absl/strings/string_view_test.cc: 在成员函数‘virtual void \xe5\x8c\xbf\xe5\x90\x8d}::StringViewTest_STL2Substr_Test::TestBody()’中:
/tmp/abseil-cpp-20240722.0/absl/strings/string_view_test.cc:719:22: 错误:no matching function for call to ‘std::basic_string_view::substr() const’
EXPECT_EQ(a.substr(), a);
^
In file included from /usr/local/gcc-7.5.0/include/c++/7.5.0/bits/basic_string.h:48:0,
from /usr/local/gcc-7.5.0/include/c++/7.5.0/string:52,
from /usr/local/gcc-7.5.0/include/c++/7.5.0/bits/locale_classes.h:40,
from /usr/local/gcc-7.5.0/include/c++/7.5.0/bits/ios_base.h:41,
from /usr/local/gcc-7.5.0/include/c++/7.5.0/ios:42,
from /usr/local/gcc-7.5.0/include/c++/7.5.0/ostream:38,
from /usr/local/gcc-7.5.0/include/c++/7.5.0/iterator:64,
from /tmp/abseil-cpp-20240722.0/absl/strings/string_view.h:35,
from /tmp/abseil-cpp-20240722.0/absl/strings/string_view_test.cc:15:
/usr/local/gcc-7.5.0/include/c++/7.5.0/string_view:254:7: 附注:candidate: constexpr std::basic_string_view<_CharT, _Traits> std::basic_string_view<_CharT, _Traits>::substr(std::basic_string_view<_CharT, _Traits>::size_type, std::basic_string_view<_CharT, _Traits>::size_type) const [with _CharT = char; _Traits = std::char_traits; std::basic_string_view<_CharT, _Traits>::size_type = long unsigned int]
substr(size_type __pos, size_type __n=npos) const
^~~~~~
/usr/local/gcc-7.5.0/include/c++/7.5.0/string_view:254:7: 附注: 备选需要 2 实参,但提供了 0 个
在全局域:
cc1plus: 警告:unrecognized command line option ‘-Wno-unused-private-field’
cc1plus: 警告:unrecognized command line option ‘-Wno-self-move’
make[2]: *** [absl/strings/CMakeFiles/absl_string_view_test.dir/string_view_test.cc.o] 错误 1
make[2]: 离开目录“/tmp/abseil-cpp-20240722.0/build”
make[1]: *** [absl/strings/CMakeFiles/absl_string_view_test.dir/all] 错误 2
make[1]: 离开目录“/tmp/abseil-cpp-20240722.0/build”
make: *** [all] 错误 2

Steps to reproduce the problem

this is my cmake parameter:
cmake ..
-DCMAKE_C_COMPILER=/usr/local/gcc-7.5.0/bin/gcc
-DCMAKE_CXX_COMPILER=/usr/local/gcc-7.5.0/bin/g++
-DCMAKE_INSTALL_PREFIX="./build"
-DCMAKE_PREFIX_PATH="/tmp/googletest-1.15.2/build"
-DABSL_PROPAGATE_CXX_STD=ON
-DCMAKE_CXX_STANDARD=17
-DABSL_BUILD_TESTING=ON
-DABSL_USE_EXTERNAL_GOOGLETEST=ON
-DABSL_FIND_GOOGLETEST=ON

What version of Abseil are you using?

I downloaded the latest version of the Abseil package, which is

Abseil LTS branch, July 2024
Abseil LTS 20240722.0
abseil-cpp-20240722.0.tar.gz

What operating system and version are you using?

[dapp@csmstestmq02 ~]$ uname
Linux
[dapp@csmstestmq02 ~]$
[dapp@csmstestmq02 ~]$ uname -a
Linux csmstestmq02 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[dapp@csmstestmq02 ~]$
[dapp@csmstestmq02 ~]$ uname -r
3.10.0-693.el7.x86_64
[dapp@csmstestmq02 ~]$

What compiler and version are you using?

[dapp@csmstestmq02 ~]$ gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-7.5.0/libexec/gcc/x86_64-redhat-linux/7.5.0/lto-wrapper
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr/local/gcc-7.5.0 --mandir=/usr/local/gcc-7.5.0/share/man --infodir=/usr/local/gcc-7.5.0/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,go --enable-plugin --enable-initfini-array --disable-libgcj --enable-graphite --enable-gnu-indirect-function --with-tune=generic --build=x86_64-redhat-linux --disable-multilib
线程模型:posix
gcc 版本 7.5.0 (GCC)
[dapp@csmstestmq02 ~]$
[dapp@csmstestmq02 ~]$ g++ -v
使用内建 specs。
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-7.5.0/libexec/gcc/x86_64-redhat-linux/7.5.0/lto-wrapper
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr/local/gcc-7.5.0 --mandir=/usr/local/gcc-7.5.0/share/man --infodir=/usr/local/gcc-7.5.0/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,go --enable-plugin --enable-initfini-array --disable-libgcj --enable-graphite --enable-gnu-indirect-function --with-tune=generic --build=x86_64-redhat-linux --disable-multilib
线程模型:posix
gcc 版本 7.5.0 (GCC)

What build system are you using?

[dapp@csmstestmq02 ~]$ cmake -version
cmake version 3.31.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[dapp@csmstestmq02 ~]$

Additional context

No response

@wangxiaokun wangxiaokun changed the title [Bug]: use c++17, build abseil-cpp-20240722.0.tar.gz, found error when make [Bug]: GCC 7.5.0, build abseil-cpp-20240722.0.tar.gz, found error when make Jan 8, 2025
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

1 participant