【发布时间】:2021-01-17 07:17:16
【问题描述】:
我正在 Visual Studio 2019 中开发 C++ Windows 窗体应用程序。
我想使用外部库 EDFlib 的一些功能。 EDFlib 是一个 C/C++ 编程库,它只包含两个文件(.c 和 .h)。
这里是一个简单的代码,当我点击一个按钮时,它会在 EDF 文件中写入数据:
#include "edflib.h"
// [...]
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
double buf[200];
for (int i = 0; i < 200; i++)
buf[i] = i;
int hdl;
hdl = edfopen_file_writeonly("test.edf", EDFLIB_FILETYPE_EDFPLUS, 1);
// [...]
edfwrite_physical_samples(hdl, buf);
edfclose_file(hdl);
}
// [...]
我有以下 2 个错误:
Erreur LNK2028 jeton non résolu (0A000038) "extern "C" int __cdecl edfopen_file_writeonly(char const *,int,int)" (?edfopen_file_writeonly@@$$J0YAHPBDHH@Z) référencé dans la fonction "private: void __clrcall TestEDF::MyForm::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@MyForm@TestEDF@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
&
Erreur LNK2019 symbole externe non résolu "extern "C" int __cdecl edfopen_file_writeonly(char const *,int,int)" (?edfopen_file_writeonly@@$$J0YAHPBDHH@Z) référencé dans la fonction "private: void __clrcall TestEDF::MyForm::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@MyForm@TestEDF@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
我尝试阅读有关这些错误的文档。 但我不是 C/C++ 专家。我不知道该怎么办。我需要一些帮助。
谢谢。
【问题讨论】:
标签: c++ c visual-c++ linker