GCC打印一个错误:
error: 'enum c_style_enum ' is not a class or namespace
142 | friend c_style_enum ::c_func();
error: ISO C++ forbids declaration of 'c_func' with no type [-fpermissive]
返回类型C_FUNC()是INT或其他枚举以外的其他类型的WOKRS
如何做这项工作?
声明不应包括
friend
enum
my_class.hpp
#pragma once
typedef enum { val1 = 0 } c_style_enum_t;
c_style_enum_t c_func();
希望,这应该解决您的汇编错误。