草庐IT

declared

全部标签

c++ - 错误 : strcpy was not declared in this scope

我在Ubuntug++版本4.4.3中编译的c++问题中遇到了这个问题。我不知道要包含哪些标题来解决这个问题。谢谢centro_medico.cpp:Inconstructor‘Centro_medico::Centro_medico(char*,char*,int,int,float)’:centro_medico.cpp:5:error:‘strcpy’wasnotdeclaredinthisscopecentro_medico.cpp:13:warning:deprecatedconversionfromstringconstantto‘char*’centro_medico.c

c++ - g++ 错误 : ‘stricmp’ was not declared in this scope (but OK for 'strcmp' )

我正在尝试编译以下非常非常简单的源代码:#include//#include//usingnamespacestd;classHelper{public:intcStringsAreEqual(constchar*s1,constchar*s2){returnstricmp(s1,s2);}};...但我收到以下错误消息:g++error:‘stricmp’wasnotdeclaredinthisscope但是,当我使用strcmp()而不是stricmp()时,一切都很好!这里有什么问题?允许strcmp()的时候不应该允许stricmp()吗?Sureley,这一切都可以在不使用s

c++ - 收到错误 : ISO C++ forbids declaration of with no type

我收到以下错误:ISOC++forbidsdeclarationofttTreeInsertwithnotypeISOC++forbidsdeclarationofttTreeDeletewithnotypeISOC++forbidsdeclarationofttTreePrintwithnotypeprototypeforintttTree::ttTreePrint()doesnotmatchanyinclassttTreecandidateis:voidttTree::ttTreePrint()这是我的头文件:#ifndefttTree_h#definettTree_hclasst

c++ - 错误 : 'INT32_MAX' was not declared in this scope

我收到了错误error:'INT32_MAX'wasnotdeclaredinthisscope但是我已经收录了#include我正在使用命令在(g++(GCC)4.1.220080704(RedHat4.1.2-44)上编译它g++-m64-O3blah.cpp我需要做任何其他事情来编译它吗?还是有另一种C++方法来获取常量“INT32_MAX”?谢谢,如果有什么不清楚的地方请告诉我! 最佳答案 引自手册页,“只有在包含__STDC_LIMIT_MACROS之前定义时,C++实现才应定义这些宏”。那就试试吧:#define__ST

c++ - 错误 : member access into incomplete type : forward declaration of

我在同一个.cpp文件中有两个类://forwardclassB;classA {voiddoSomething(B*b){b->add();}};classB{voidadd(){...}};转发不起作用,我无法编译。我得到这个错误:error:memberaccessintoincompletetype'B'note:forwarddeclarationof'B'我正在使用clang编译器(clang-500.2.79)。我不想使用多个文件(.cpp和.hh),我想只在一个.cpp上编写代码。我不能在A类之前写B类。您知道如何解决我的问题吗? 最佳答案

c++ - VS 2015编译cocos2d-x 3.3报错 "fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration"

当我使用visualstudio2015编译cocos2d-x(3.3版)时,出现错误,说:fatalerrorC1189:#error:MacrodefinitionofsnprintfconflictswithStandardLibraryfunctiondeclaration(编译源文件..\base\s3tc.cpp)源码为:#ifdefsnprintf#errorMacrodefinitionofsnprintfconflictswithStandardLibraryfunctiondeclaration#endif谁能告诉我怎么了? 最佳答案

c++ - 错误 : Class has not been declared despite header inclusion, 并且代码在其他地方编译正常

所以我有一个包含在另一个类中的类,它不断抛出形式为“错误:'ProblemClass'没有被声明的编译错误。文件是这样设置的:#ifndefPROBLEMCLASS_H#definePROBLEMCLASS_H#include#includeclassProblemClass{public:virtualvoidInit()=0;};#endif出现错误的类如下所示:#ifndefACLASS_H#defineACLASS_H#include"problemclass.h"classAClass:publicBase{public:voidDoSomething(ProblemClas

Eclipse IDE 中的 C++ 错误 'nullptr was not declared in this scope'

我正在运行EclipseHelios,并且安装了g++-4.6。希望g++4.6实现C++11特性我没有错。我创建了一个使用nullptr和auto关键字的C++项目。该构建给出以下错误:-../{filename}.cpp:13:13:error:‘nullptr’wasnotdeclaredinthisscope../{filename}.cpp:14:2:warning:‘auto’willchangemeaninginC++0x;pleaseremoveit[-Wc++0x-compat]实际上,直到昨天它还在build中。我今天不知从何而来。请帮我解决这个问题。

java - : The serializable class does not declare a static final serialVersionUID field?是什么意思

这个问题在这里已经有了答案:WhatisaserialVersionUIDandwhyshouldIuseit?(25个回答)关闭4年前。我有标题中给出的警告信息。我想了解并删除它。我已经找到了关于这个问题的一些答案,但由于技术术语过多,我不理解这些答案。能不能用简单的话来解释这个问题?附:我知道OOP是什么。我知道什么是对象、类、方法、字段和实例化。附言如果有人需要我的代码,就在这里:importjava.awt.*;importjavax.swing.*;publicclassHelloWorldSwingextendsJFrame{JTextAream_resultArea=ne

c++ - 错误 : ‘NULL’ was not declared in this scope

在gcc4.3上编译C++时收到此消息error:‘NULL’wasnotdeclaredinthisscope它出现又消失,我不知道为什么。为什么?谢谢。 最佳答案 NULL不是关键字。它是一些标准头文件中定义的标识符。你可以包括#include将其纳入范围,包括其他一些基础知识,例如std::size_t。 关于c++-错误:‘NULL’wasnotdeclaredinthisscope,我们在StackOverflow上找到一个类似的问题: https: