I am using c++ to develop my software on ArchLinux.
If I install a library, for example, libffmpeg
, from the official source, such as apt
on Ubuntu, pacman
on Archlinux.
However, in my project, I use clang
as the compiler.
My question is:
Which compiler does the official package use? Do I have to use the same compiler?For example, the official package uses
gcc
, so that I have to usegcc
instead ofclang
.If I have to use the same compiler,
gcc
, do I have to use the same version? For example, the official package usesgcc9
, do I have to usegcc9
? Can I usegcc8
?
/*******************************************************************************/
Recently when I compile my code, I found there is an error:
undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
It seems that it cannot find std::__cxx11::basic_ostringstream
. I searched on the Internet and find from gcc5
it has a new feature. I have to use
//CMakeLists.txtadd_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
in my CMakeLists.txt
file.But it doesn't work.
Is it because I use a different compiler version?