Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/141.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何将属性别名定义为c++;功能?_C++_Linux_Gcc_Compiler Errors - Fatal编程技术网

C++ 如何将属性别名定义为c++;功能?

C++ 如何将属性别名定义为c++;功能?,c++,linux,gcc,compiler-errors,C++,Linux,Gcc,Compiler Errors,在我的cpp文件中,我有以下内容: int A() { } void B_A() __attribute__((alias ("A"))); 我得到了一个错误: B_A()别名为未定义的符号A; 然而,正如你所注意到的,在这之前定义了A 那有什么问题 来自: 在C++中,必须使用目标的已被修改的名称。< /P> 因此,您需要A的损坏名称,或者您需要给AC链接,这样它的名称一开始就不会被损坏。来源: 在C++中,必须使用目标的已被修改的名称。< /P> 因此,您需要A的损坏名称,或者您需要给AC

在我的cpp文件中,我有以下内容:

int A()
{
}
void B_A() __attribute__((alias ("A")));
我得到了一个错误: B_A()别名为未定义的符号A; 然而,正如你所注意到的,在这之前定义了A

那有什么问题

来自:

<>在C++中,必须使用目标的已被修改的名称。< /P> 因此,您需要
A
的损坏名称,或者您需要给
A
C链接,这样它的名称一开始就不会被损坏。

来源:

<>在C++中,必须使用目标的已被修改的名称。< /P> 因此,您需要
A
的损坏名称,或者您需要给
A
C链接,这样它的名称一开始就不会损坏