undeclared-identifier

C++ Undeclared Identifier (but it is declared?)

社会主义新天地 提交于 2019-12-02 07:20:50
问题 I'm pretty sure I've included the qanda class, but when I try to declare a vector that contains it or a class of that type I get an error saying that qanda is undefined. Any idea what the problem might be? bot_manager_item.h #pragma once #include "../bot_packet/bot_packet.h" #include <vector> class bot_manager_item; #include "qanda.h" #include "bot_manager.h" class bot_manager_item { public: bot_manager_item(bot_manager* mngr, const char* name, const char* work_dir); ~bot_manager_item(); bool

What is an &#39;undeclared identifier&#39; error and how do I fix it?

左心房为你撑大大i 提交于 2019-11-26 00:33:37
问题 What are undeclared identifier errors? What are common causes and how do I fix them? Example error texts: For the Visual Studio compiler: error C2065: \'cout\' : undeclared identifier For the GCC compiler: \'cout\' undeclared (first use in this function) 回答1: They most often come from forgetting to include the header file that contains the function declaration, for example, this program will give an 'undeclared identifier' error: Missing header int main() { std::cout << "Hello world!" << std: