问题描述
我已经制作了libfann并将其附加到我的项目中
而且我已经编写了这些代码,但是由于编译,它给出了这3个链接器错误!为什么?
错误8错误LNK2019:在函数"public:void __thiscall CTTSPDlg :: OnBnClickedButton2(void)"中引用了未解析的外部符号__imp__fann_destroy @ 4(?OnBnClickedButton2 @ CTTSPDlg @@ QAEXXZ)TTS-PDlg.obj
-------
错误9错误LNK2019:在函数"public:void __thiscall CTTSPDlg :: OnBnClickedButton2(void)"中引用了未解析的外部符号__imp__fann_create_standard(?OnBnClickedButton2 @ CTTSPDlg @@ QAEXXZ)TTS-PDlg.obj
-------------
错误10致命错误LNK1120:2个未解决的外部组件D:\ TTS \ Programming \ Delete1 \ Debug \ TTS-P.exe
-------------
I have made libfann and attached it to my project
and also I''ve wrote these code, but due the compilation it gives these 3 linker errors! Why?
Error8error LNK2019: unresolved external symbol __imp__fann_destroy@4 referenced in function "public: void __thiscall CTTSPDlg::OnBnClickedButton2(void)" (?OnBnClickedButton2@CTTSPDlg@@QAEXXZ)TTS-PDlg.obj
-------
Error9error LNK2019: unresolved external symbol __imp__fann_create_standard referenced in function "public: void __thiscall CTTSPDlg::OnBnClickedButton2(void)" (?OnBnClickedButton2@CTTSPDlg@@QAEXXZ)TTS-PDlg.obj
-------------
Error10fatal error LNK1120: 2 unresolved externalsD:\TTS\Programming\Delete1\Debug\TTS-P.exe
-------------
#include "floatfann.h"
.
.
.
{
struct fann *ann = fann_create_standard(3,2,4,1);
fann_destroy(ann);
}
推荐答案
#ifdef _MSC_VER /* MicroSoft C++ compiles, declare externals as "C" calling standard */
#ifdef __cplusplus
extern "C" {
#endif
#endif
// place the declarations / function prototypes for fann_create_standard and fann_destroy here
#ifdef _MSC_VER
#ifdef __cplusplus
}
#endif
#endif
这篇关于我如何在VC ++(MFC)中通过FANN实现神经网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!