Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22130

Conflicts between installed library and my code due to compiler variation on Linux

$
0
0

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:

  1. 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 use gcc instead of clang.

  2. If I have to use the same compiler, gcc, do I have to use the same version? For example, the official package uses gcc9, do I have to use gcc9? Can I use gcc8?

/*******************************************************************************/

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?


Viewing all articles
Browse latest Browse all 22130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>