回 帖 发 新 帖 刷新版面

主题:dll文件如何加上io.h文件头?

我编的DLL文件,预处理如下:

#include<stdio.h>
#include<io.h>
extern "C" __declspec(dllexport) void __stdcall read
(char *,short,long int,int,short *);

在下面定义的read函数中,要用到filelength命令。

------------------------
下面是调试结果:

点击make按钮,显示错误:
Build
  [C++ Error] Unit1.cpp(11): E2337 Only one of a set of overloaded functions can be "C"
错误标记停在(char *,short,long int,int,short *);这一行上。

当我删掉#include<io.h>时,该故障消失了。但是,程序执行到filelength命令时,显示错误:[C++ Error] Unit1.cpp(32): E2268 Call to undefined function 'filelength'

请教大家:filelength命令与#include<io.h>语句如此“水火不相容”,我该怎么办呢?

回复列表 (共1个回复)

沙发

extern "C" __declspec(dllexport) void __stdcall read
(char *,short,long int,int,short *);

中的 read 是你自己定义的函数?可能是因为她和 #include<io.h> 中的 read 重名了。

你改成其他名字试试看,比如 MyRead

我来回复

您尚未登录,请登录后再回复。点此登录或注册