我通过用外部"C“包装头文件来调用VS2010中的C静态链接库,但是我仍然得到一个LNK2001: unresolved外部符号。我在其他地方调用相同的.lib文件,没有任何问题,而且我正在重用其他地方的旧代码,这肯定是有效的。我使用的代码可以在github.com/toots/microsoft-audio-watermarking.中找到我正在尝试使用hwast.h中的"thrabs“函数。我想不出任何明显的原因它不能工作。下面是示例代码。thrabs是外部的c。有没有可能是我在C++中定义的变量_fm_lookup出了问题?
int i;
for(i = 0; i < NFREQ; i++)
_fm_lookup[i] = thrabs((0.5 + i) * (float) fs * 0.5 / (float) NFREQ);C静态库是通过使用
extern "C" { #include "htres.h" }
错误是
Error 37 error LNK2001: unresolved external symbol _fm_lookup C:\Users\David\Documents\Projects\watermarking\Builds\VisualStudio2010\internal2003.lib(hthres.obj)发布于 2016-06-02 06:42:31
需要将有问题的代码移动到它自己的c文件中,并在使用外部"C“时从那里调用它。惨痛的教训。
https://stackoverflow.com/questions/37576492
复制相似问题