我最近使用 WinSock 编写代码,当我尝试调用 WSAStartup 时,编译器抛出了这个错误:
undefined reference to `WSAStartup@8'
我以前处理过这类问题,它们没什么大不了的,我一定是漏掉了定义什么的。但是,此线程针对不同的主题:@8 是什么意思?
如果你试图在没有 main 函数的情况下编译一个文件,它会抛出:
undefined reference to `WinMain@16'
同样,臭名昭著的@Number。我试图在网上查找它,但老实说我不知道从哪里开始,因为我最终得到的只是编译器错误的解决方案,与@16、@8 或@X 的起源无关。
我一直想知道的另一件事是引号是怎么回事:
`something'
为什么开头的引语和结尾的不同?首先使用反引号 ( ` ) 有什么意义?
最佳答案
数字是它的函数参数的字节。
来自 MSDN :
For __stdcall functions, names include the "@" character and a decimal number that specifies the number of bytes in its function parameters. For example, the decorated name of the LoadLibrary function is LoadLibrary@4. For C++ functions the name decoration is more complex and varies from compiler to compiler.
关于c++ - 函数引用FuncName@Number,@X是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42757613/