"ISO C++ forbids declaration of 'list' with no type"错误
"ISO C++ forbids declaration of 'list' with no type" error
我在包含以下内容的每一行上不断收到以下错误list<string>
:
-
ISO C++ forbids declaration of 'list' with no type
-
expected ';' before '<' token
#ifndef __REGNAMEGENERATOR_H
#define __REGNAMEGENERATOR_H
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <sstream>
#define Max_reg_Num 1000
using namespace std;
class RegNameGenerator{
private:
int intRegNumber;
int realRegNumber;
list<string> UsedIntReg; // error
list<string> UsedRealReg; // error
public:
RegNameGenerator();
~RegNameGenerator();
string generateIntReg();
string generateRealReg();
list <string> getUsedIntReg(); // error
list <string> getUsedRealReg(); // error
int getIntRegNum();
int getRealRegNum();
};
#endif
您必须包含标头<list>
:
#include <list>
相关文章:
- "error: no matching function for call to"构造函数错误
- 调用专用模板时出错"no matching function for call to [...]"
- Problems with std::cin.fail()
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- c++20[[no.unique_address]]中的新功能是什么
- 以线程安全的方式调用"QQuickPaintedItem::updateImage(const QImage&image)"(no QThread)
- "no matching function for call to 'Vector::Vector'"错误
- 这对"With a stackless coroutine, only the top-level routine may be suspended."意味着什么
- Android NDK clang 编译器错误在 Windows 上显示'No such file or directory'
- Boost.TEST with CLion: "Test framework quit unexpectedly"
- 避免碎片化的ClientHellos with OpenSSL (DTLS)
- Issues with Win32 ReadProcessMemory API
- Qt with WinAPI MouseProc
- [[maybe_unused]] with structured_binding?
- "Unable to start debugging. No process is associated with this object." - 在Visual Studio Code中使用GDB
- "ISO C++ forbids declaration of 'list' with no type"错误
- CMake with cygwin " make[2]: *** No rule to make target 'cygwin' "
- 模板函数指针:"overloaded function with no contextual type information"
- C++结构和"error: ISO C++ forbids declaration of '...' with no type"
- 使用 MingW64 C++ "declaration of '__RPC__range' with no type"编译 IMAPI2.h 应用程序时出现错误