草庐IT

c++ - GCOV:使用 GCC 构建时 --coverage 和 --ftest-coverage 有什么区别?

尝试启动并运行代码覆盖率,我只是先阅读文档。我发现一些文章提到了使用--coverage标志进行构建,而其他文章提到了--ftest-coverage。两个描述似乎都说它们做同样的事情,但我不确定。这里有两篇文章:http://bobah.net/d4d/tools/code-coverage-with-gcovhttp://www.osadl.org/Dumping-gcov-data-at-runtime-simple-ex.online-coverage-analysis.0.html有什么区别? 最佳答案 正如评论中所述,-

c++ - 为什么 void_t<> 检测习语不适用于 gcc-4.9?

这个问题在这里已经有了答案:C++11:SFINAEintemplateparameters,GCCvsClang[duplicate](1个回答)关闭6年前。考虑以下代码:#include#includestructTest{Test&operator++();};structNoIncrement{};templateusingvoid_t=void;template>structhas_pre_increment_member:std::false_type{};templatestructhas_pre_increment_member())>>:publicstd::true

c++ - 为什么 void_t<> 检测习语不适用于 gcc-4.9?

这个问题在这里已经有了答案:C++11:SFINAEintemplateparameters,GCCvsClang[duplicate](1个回答)关闭6年前。考虑以下代码:#include#includestructTest{Test&operator++();};structNoIncrement{};templateusingvoid_t=void;template>structhas_pre_increment_member:std::false_type{};templatestructhas_pre_increment_member())>>:publicstd::true

c++ - 在 C++11 中使用 decltype() 时出错(在 gcc 4.7.0 中创建不透明的错误消息)

使用以下代码(我的原始代码的简化版本)#include#includetemplateclassA;//edit1followingMark&MatthieutemplateclassA{Xa;templatefriendclassA;//edit1followingMark&Matthieupublic:A(Xx):a(x){}Xget()const{returna;}//edit2toavoidusingA::atemplateautodiff(Aconst&y)const->decltype(a-y.a)//originalcodecausingerrorwithgcc->typ

c++ - 在 C++11 中使用 decltype() 时出错(在 gcc 4.7.0 中创建不透明的错误消息)

使用以下代码(我的原始代码的简化版本)#include#includetemplateclassA;//edit1followingMark&MatthieutemplateclassA{Xa;templatefriendclassA;//edit1followingMark&Matthieupublic:A(Xx):a(x){}Xget()const{returna;}//edit2toavoidusingA::atemplateautodiff(Aconst&y)const->decltype(a-y.a)//originalcodecausingerrorwithgcc->typ

c++ - 如何在 GCC x86 中使用 RDTSC 计算时钟周期?

这个问题在这里已经有了答案:HowtogettheCPUcyclecountinx86_64fromC++?(5个回答)关闭4年前。使用VisualStudio,我可以从处理器读取时钟周期计数,如下所示。如何使用GCC做同样的事情?#ifdef_MSC_VER//Compiler:MicrosoftVisualStudio#ifdef_M_IX86//Processor:x86inlineuint64_tclockCycleCount(){uint64_tc;__asm{cpuid//serializeprocessorrdtsc//readtimestampcountermovdwo

c++ - 如何在 GCC x86 中使用 RDTSC 计算时钟周期?

这个问题在这里已经有了答案:HowtogettheCPUcyclecountinx86_64fromC++?(5个回答)关闭4年前。使用VisualStudio,我可以从处理器读取时钟周期计数,如下所示。如何使用GCC做同样的事情?#ifdef_MSC_VER//Compiler:MicrosoftVisualStudio#ifdef_M_IX86//Processor:x86inlineuint64_tclockCycleCount(){uint64_tc;__asm{cpuid//serializeprocessorrdtsc//readtimestampcountermovdwo

c++ - 如何在 Windows 上使用 GCC 4 构建 LLVM?

我已经能够使用MinGWGCC3.4.5构建LLVM2.6(llvm-2.6.tar.gz包)。我没有正确测试,但它似乎可以工作。问题是,我有自己的库,它们不使用GCC3构建,但在GCC4中可以正常工作(模板问题)。我相信MinGW的第一个官方GCC4版本是GCC4.4.0。编辑整洁-“试过这个试过那个”信息中的所有有用信息现在都在答案中。编辑这个问题/答案的大部分对于LLVM2.7来说都是多余的-标准配置,使例程在MinGW中正常工作,没有任何黑客或变通方法。 最佳答案 如果一开始你没有成功...我现在可以使用MinGWGCC4.

c++ - 如何在 Windows 上使用 GCC 4 构建 LLVM?

我已经能够使用MinGWGCC3.4.5构建LLVM2.6(llvm-2.6.tar.gz包)。我没有正确测试,但它似乎可以工作。问题是,我有自己的库,它们不使用GCC3构建,但在GCC4中可以正常工作(模板问题)。我相信MinGW的第一个官方GCC4版本是GCC4.4.0。编辑整洁-“试过这个试过那个”信息中的所有有用信息现在都在答案中。编辑这个问题/答案的大部分对于LLVM2.7来说都是多余的-标准配置,使例程在MinGW中正常工作,没有任何黑客或变通方法。 最佳答案 如果一开始你没有成功...我现在可以使用MinGWGCC4.

c++ - GCC 运行时库与 Microsoft Visual C++ 运行时可再发行组件

谁能解释一下C++库的版本控制和分布GCC库(libgcc、libstdc++、..?)MicrosoftVisualC++运行时库(6.0、2005、2008、2010、2012、2013、2015......)由于我对GCC编程的了解有限,我从未见过C++运行时库与程序一起分发。MSWindows程序经常出现这种情况。相对较旧的linux系统能否运行较新的C++14程序(在较新的系统上编译然后复制到旧系统)?GCC程序员是否将运行时库与程序一起分发?如果不是,为什么Windows程序分发它们?GCC发行版如何确保C++程序在安装时始终运行?Qt等框架怎么样,Qt如何处理Linux和