我正在尝试编译code :: blocks中的metatrader 4 c ++ api库之一。 这是主程序
`#include "stdio.h"
#include "MT4APITest.h"
int main(void)
{
char err[255];
SunkTCPClient* pCl = MT4_TC_StartClient("127.0.0.1", 4567, err);
MT4APITest test;
test.Run(pCl);
return 0;
}`
在构建选项中 - > liker设置,我已经包含了相对路径" bin / Debug / MT4_API.lib"
在构建选项中 - >搜索目录 - >编译器 - >,我已经包含了" C:\ home \ mt4 \"。这是我保存mt4_API.dll库的文件夹。在同一文件夹中,我已放置在文件下方。
`main.cpp
MT4_API.h
MT4_APITest.cpp
MT4_APITest.h
mt43.cbp (for code blocks).`
当我编译它时,编译命令结果是
mingw32-g++.exe -o bin\Debug\mt43.exe obj\Debug\main.o obj\Debug\MT4APITest.o bin\Debug\MT4_API.lib
并收到错误
C:/cygwin/home/LENOVO/mt4/mt43/main.cpp:10: undefined reference to MT4_TC_StartClient(char const*, int, char*, wchar_t const*)@16'
obj\Debug\MT4APITest.o: In function ZN10MT4APITest15TestAccountInfoEv':
C:/cygwin/home/LENOVO/mt4/mt43/MT4APITest.cpp:48: undefined reference to MT4_TC_GetAccountInfo(SunkTCPClient*, MT4AccountInfo*)@8'
C:/cygwin/home/LENOVO/mt4/mt43/MT4APITest.cpp:48: undefined reference to MT4_TC_GetErrorDescription(MT4_RET_CODE)@4'
obj\Debug\MT4APITest.o: In function ZN10MT4APITest14TestSymbolInfoEv':
C:/cygwin/home/LENOVO/mt4/mt43/MT4APITest.cpp:57: undefined reference to MT4_TC_GetSymbolListCount(SunkTCPClient*, int*)@8
并继续列表。我可以知道我在这里失踪了吗。