调用未定义的函数错误 [英] Call to undefined function error

查看:217
本文介绍了调用未定义的函数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i制作程序来控制七段但是当我进行调试时

告诉我调用未定义的函数inportb

hi
i made program to control sevensegment but when i make debug
tell me call to undefined function inportb

展开 | 选择 | Wrap | 行号

推荐答案

头文件< dos.h>,< conio.h>和< streamio.h>仅适用于某些平台 - 它们不属于标准C.您确定它们可在您的平台上使用吗?


函数inportb和outportb仅适用于某些平台 - 它们不是标准C的一部分。您确定它们在您的平台上可用吗?您的错误消息表明链接器中至少有一个不可用。您可能需要在命令行上指定对象库。必要的对象库的名称取决于平台。


顺便问一下,你的平台是什么?


头文件< stdio .H>是标准C的一部分;但是头文件< streamio.h>可能旨在引用标准C ++的一部分< streamio>。你真的不想把它们混在一起。您使用的是C还是C ++?
Header files <dos.h>, <conio.h>, and <streamio.h> are only available on certain platforms -- they are not part of Standard C. Are you sure they are available on your platform?

Functions inportb and outportb are only available on certain platforms -- they are not part of Standard C. Are you sure they are available on your platform? Your error message suggests that at least one of them wasn''t available to the linker. You may need to specify an object library on the command line. The name of the necessary object library is platform-dependent.

By the way, what is your platform?

Header file <stdio.h> is part of Standard C; but header file <streamio.h> might be intended to refer to <streamio>, part of Standard C++. You really don''t want to mix these together. Are you using C or C++?


无论如何,您不能通过win32程序的地址和win2k及更高版本的dos程序写入io端口。你需要找到一些允许你这样做的驱动程序(dlportio,giveio等)。他们中的大多数人都没有在vista上工作。
Anyway, you can''t write to io ports by address from win32 program, and from dos program on win2k and later. You need to find some driver that allows you to do it ( dlportio, giveio, etc ). And most of them don''t work on vista.


最后主要应该是


int main()
< br $>



int main(int argc,char ** argp)


但不是


void main(int n)
and finally main should be either

int main()

or

int main(int argc, char **argp)

but not

void main(int n)


这篇关于调用未定义的函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆