草庐IT

compiler-sfc

全部标签

c++ - "The C++ compiler "/usr/bin/c++ "is not able to compile a simple test program."尝试安装 OpenCV 时

我正尝试按照此link在我的Mac上安装OpenCV但是,当我在终端上键入cmake-G"UnixMakefiles"..时,会打印出此错误。--TheCXXcompileridentificationisunknown--TheCcompileridentificationisunknown--CheckforworkingCXXcompiler:/usr/bin/c++--CheckforworkingCXXcompiler:/usr/bin/c++--brokenCMakeErrorat/opt/local/share/cmake-3.0/Modules/CMakeTestCXX

c++ - VS2010 : "Cannot find the resource compiler DLL. Please make sure the path is correct."

我一直在关注theForger'swin32APItutorial,然后我决定打开menu_one.rc文件以从VS2010中查看其内容,但我收到此错误:我已经仔细检查了这两个位置,但实际上这两个文件都不存在。我仅有的rcdll.dll拷贝位于:C:\ProgramFiles(x86)\MicrosoftSDKs\Windows\v7.0A\Bin\rcdll.dllandC:\ProgramFiles(x86)\MicrosoftSDKs\Windows\v7.0A\Bin\x64\rcdll.dll我试过做repairinstalloftheWindowsSDK,但这并没有解决问题

C++ v 表 : Part of the language or compiler dependent?

v表(virtualmethodtable)是C++规范的一部分,还是由编译器来解决虚方法查找?如果它是规范的一部分:为什么?我猜它依赖于编译器,但有人对我说它是规范的一部分。非常欢迎引用! 最佳答案 1.7TheC++memorymodel3[...]Variousfeaturesofthelanguage,suchasreferencesandvirtualfunctions,mightinvolveadditionalmemorylocationsthatarenotaccessibletoprogramsbutaremana

c++ - 在 Xcode : error during compilation: STL vector 中编译 C++ 类

我有一个C++类,它可以在带有gcc的Linux上和在visualstudio中的widows上正常编译。boid.h:#ifndefBOID_CLASS_HEADER_DEFINES_H#defineBOID_CLASS_HEADER_DEFINES_H#include"defines.h"classBoid{public://Initializetheboidwithrandomposition,headingdirectionandcolorBoid(floatSceneRadius,floatNormalVel);.....protected:...};#endif在boid.

c++ - 使用可变参数模板重载函数模板 : Intel c++ compiler version 18 produces different result from other compilers. intel 错了吗?

考虑以下代码片段:templateclassA,typename...Ts>inta(Aarg){return1;//Overload#1}templateinta(Aarg){return2;//Overload#2}templatestructS{};intmain(){returna(S());}在使用模板类的实例调用函数a时,我希望编译器选择更特殊的函数重载#1。根据compilerexplorer、clang、gcc和17版之前的英特尔实际上会选择重载#1。相反,后来的英特尔编译器版本(18和19)选择重载#2。是代码定义不正确还是最新的英特尔编译器版本有误?

c++ - 自动模板参数 : g++ 7. 3 vs clang++ 6.0 : Which compiler is correct?

对于这个代码示例,两个编译器会产生不同的结果。Clang生成两种不同的类型。G++对fu和fi使用相同的类型。哪个符合标准?#includetemplatestructfoo{decltype(IVAL)x=-IVAL;};intmain(){foofu;foofi;std::coutg++-7.3输出:42949672864294967286clang-6.0输出:-104294967286 最佳答案 gcc在这里是错误的,这显然是两种不同的类型。并确认-此错误已在gcc8.0.1中修复Samplecode

c++ - 有符号右移 : which compiler use logical shift

我用VisualStudio、Ubuntu的GCC、Intel编译器、MinGW测试了右移。全部移入符号位。我想Xcode的GCC也是如此。我知道该行为是特定于实现的,但看起来所有主要的桌面/服务器编译器都实现了算术移位。有没有符号位不移位的广泛使用的编译器?谢谢。 最佳答案 C在很多不同的架构上运行。我的意思是很多不同的架构。您可以获得在嵌入式DSP和Craysuper计算机上运行的C代码。人们认为理所当然的C标准中的大多数“实现定义”部分实际上只会破坏晦涩的体系结构。例如,有一些DSP和Craysuper计算机,其中CHAR_B

c++ - AVR 工作室 5 : compile C++ code

在AVRStudio5中创建项目时,它会创建一个包含以下内容的.c文件:#includeintmain(void){while(1){//TODO::Pleasewriteyourapplicationcode}}构建这个C程序工作得很好:------RebuildAllstarted:Project:AVRGCC2,Configuration:DebugAVR------Buildstarted.Project"AVRGCC2.avrgccproj"(ReBuildtarget(s)):Target"PreBuildEvent"skipped,duetofalsecondition;

c++ - Visual Studio - 升级后为 "Unknown Compiler version"

我有一个VisualStudio2015C++项目,我想升级到VS2017。当我第一次在VS2017中打开我的项目时,我已经拒绝了升级我的项目的自动提示(不确定我想升级到时间)所以我不能那样更新我的项目。相反,我只是去了我的项目:属性->配置属性->常规我在那里将“平台工具集”选项更新为“VisualStudio2017(v141)”,并将“WindowSDK版本”从Windows8.1更改为10.0.16299.0。执行此手动升级后,我现在在构建时收到警告:Unknowncompilerversion-pleaseruntheconfiguretestsandreporttheres

c++ - 演绎指南、模板和子对象 : which compiler is right?

考虑以下片段:structS{S(){}templatestructT{T(B&&){}};templateT(B&&)->T;};intmain(){S::Tt{0};}铿锵acceptsit而GCCrejectsthecode出现以下错误:prog.cc:10:5:error:deductionguide'S::T(B&&)->S::T'mustbedeclaredatnamespacescope这是有效的代码吗?哪个编译器是正确的,GCC还是Clang? 最佳答案 根据http://en.cppreference.com/w/