iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.59k stars 3.88k forks source link

no matching member function for call to 'replace' #4969

Open linjianshu opened 7 months ago

linjianshu commented 7 months ago

hello, i meet a error when i try to install bcc, the llvm version is 10.0.1 and the clang version is 10.0.1 ,the error msg is below:

make[2]: [src/cc/CMakeFiles/bcc-loader-static.dir/common.cc.o] Error 1 make[2]: [src/cc/CMakeFiles/bpf-static.dir/common.cc.o] Error 1 make[1]: [src/cc/CMakeFiles/bcc-loader-static.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... make[1]: *** [src/cc/CMakeFiles/bpf-static.dir/all] Error 2 /var/mllb/bcc-master/src/cc/common.cc:178:18: error: no matching member function for call to 'replace' field_name.replace(pos1 + 1, pos2 - pos1 - 1, dim, 0);


/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/basic_string.h:4730:7: note: candidate function not viable: no known conversion from 'std::basic_string<char>' to 'const char *' for 3rd argument
      replace(size_type __pos, size_type __n1, const _CharT* __s,
      ^

how should i fix this problem? appreciate it very much!!!

env below:
[root@gzinf-computer-55e235e17e30 build]# clang --version 
clang version 10.0.1 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
[root@gzinf-computer-55e235e17e30 build]# llvm-config --version 
10.0.1

[root@gzinf-computer-55e235e17e30 build]# echo $PATH
/usr/local/bin:/usr/local/bin:/opt/rh/devtoolset-7/root/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin