[情况]
我正在开发一个c ++库.我的GLIBCXX版本有问题.
以前,我在版本机GLIBCXX_3.4.22上开发.
但是我的库没有处理具有GLIBCXX_3.4.19的目标机器.
因此,我将gcc版本从5.2.x降级到4.8.x,将GLIBCXX版本从3.4.22降级到3.4.19.
它成功运行在目标计算机上.
但我的开发机器(ubuntu)启动失败,因为其他库找不到已链接到该版本的GLIBCXX 3.4.22版本.
所以,我重新安装了GLIBCXX 3.4.22,但gcc版本仍为4.8.5.
[题]
我的库在gcc-4.8.5上编译不使用GLIBCXX_3.4.22版本吗?在这种环境下开发是否可以(gcc 4.8.5,GLIBCXX_3.4.22)?
linux机器上的gcc(编译)版本和GLIBCXX(GLIBC)版本之间有什么关系.
在哪里可以检查gcc和GLIBCXX(GLIBC)之间的正确版本兼容性映射信息?
这是我的测试代码.
string str=string("def");
const char* c_str=str.c_str();
char* charString=(char*)"abc";
char* target;
cout << "str : "<< str<< endl;
cout << "c_str : "<< c_str << endl;
cout << "charString : " << charString << endl << endl;
cout << "string length : " << str.length() << endl;
cout << "c_str length : " << strlen(c_str) << endl;
cout << "c_str array length : " << (sizeof(c_str)/sizeof(*c_str)) << endl;
cout << "charString length : " << strlen(charString) << endl;
cout << "charString …Run Code Online (Sandbox Code Playgroud)