澳门新葡亰信誉平台游戏D 语言 2.088.0 发布,改进了与 C++ 的互操作性

by admin on 2020年2月12日

D 语言 2.088.0 发表了,此版本共修复了 58 个 bug,并对编写翻译器引进了 27
项重要改良。

gcc6.3编写翻译c++11的前后相继链接opencv时字符型函数未定义,gcc6.3opencv

在Windows下编写制定图像管理程序,由于要运用regex,进级了mingw,编写翻译c++11代码。在此之前代码中利用了opencv2.4.10,一向运转突出,进级编译器现在开掘了错误:
undefined reference to
`cv::imread(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
int)’
原因:
If you get linker errors about undefined references to symbols that
involve types in the std::__cxx11 namespace or the tag [abi:cxx11]
then it probably indicates that you are trying to link together object
files that were compiled with different values for the
_GLIBCXX_USE_CXX11_ABI macro. This commonly happens when linking to
a third-party library that was compiled with an older version of GCC. If
the third-party library cannot be rebuilt with the new ABI then you will
need to recompile your code with the old ABI
Defining the following macro before including any standard library
headers should fix your problem:
#define _GLIBCXX_USE_CXX11_ABI 0

在Windows下编写制定图像管理程序,由于要动用regex,晋级了mingw,编写翻译c++11代码。之…

在Windows下编写制定图像处理程序,由于要运用regex,进级了mingw,编写翻译c++11代码。以前代码中接受了opencv2.4.10,平素运维特出,进级编写翻译器未来发掘了错误:
undefined reference to
`cv::imread(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
int)’
原因:
If you get linker errors about undefined references to symbols that
involve types in the std::__cxx11 namespace or the tag [abi:cxx11]
then it probably indicates that you are trying to link together object
files that were compiled with different values for the
_GLIBCXX_USE_CXX11_ABI macro. This commonly happens when linking to
a third-party library that was compiled with an older version of GCC. If
the third-party library cannot be rebuilt with the new ABI then you will
need to recompile your code with the old ABI
Defining the following macro before including any standard library
headers should fix your problem:
#define _GLIBCXX_USE_CXX11_ABI 0

那是二个工作日版本,并从未什么样更新亮点,大多数都以惯常尊崇,可是个中 C++
互操作方面可能值得说。

此版本分别在 DRuntime 模块 core.stdcpp.string 和 core.stdcpp.vector
中绑定了 std::string 和 std::vector,使得与 C++
的互操作性拿到了超大的改过。个中存在二个宽容难题,需求留意。在 Linux
上编写翻译时,当 D 使用 GCC 库和链接器,在利用相符 C++ 11 的今世版本的
std::string 时相会世宽容性难题。它包涵一个里边指针,在 D
中既违法又与活动语义不相配。消释办法是将 -D_GLIBCXX_USE_CXX11_ABI =
0 传递给 G++ 并使用 -version = _GLIBCXX_USE_CXX98_ABI 编译 D 应用。

端详查看更新表达:

https://dlang.org/blog/2019/09/06/dmd-2-088-0-released

(文/开源中夏族民共和国卡塔尔(قطر‎    

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图