我正在try 用MSVC编写一个使用intsafe.h标头的简单程序:
#include <intsafe.h>
int main(void) {
int result;
return IntAdd(10, 10, &result);
}
当我试图编译这个程序时,我从链接器中得到一个错误
/opt/msvc/bin/x86/cl test.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32825 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
Microsoft (R) Incremental Linker Version 14.37.32825.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
test.obj : error LNK2019: unresolved external symbol _IntAdd referenced in function _main
test.exe : fatal error LNK1120: 1 unresolved externals
但是,我找不到IntAdd符号所在的位置.我对MSVC发行版附带的所有.lib文件使用了Dumpbin,但没有一个文件显示这个符号.IntAdd的文档也没有提到任何库(与this等其他函数形成对比),所以我不确定要告诉链接器什么