在线等啊!!C语言里面的fopen问题
是这样的,由于是windows下面的仿GCC编译环境,开发手机的.我需要读取INI文件,使用fopen(filename,"r")函数,编译时出现m68k-coff/lib/libc.a(filer.o): In function `_open_r':
..../newlib/libc/reent/openr.c:63: undefined reference to `open'
这样的错误.
libc.a是上位机提供的,请问这是什么问题啊?是不是要换个libc.a?我机器上没有,只有c++的libc.lib.
我google了一下.,可我能力有限,明白大意具体怎么弄不明白.第一次开发C程序,我本来是做D的.
还有,只要读取出普通的ANSI的.txt或者ini的内容即可.
/usr/local/m68k-coff/lib/libc.a(sbrkr.o): In function `_sbrk_r':
sbrkr.c:60: undefined reference to `sbrk'
/usr/local/m68k-coff/lib/libc.a(makebuf.o): In function `__smakebuf':
makebuf.c:93: undefined reference to `isatty'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_open_r':
filer.c:63: undefined reference to `open'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_close_r':
filer.c:100: undefined reference to `close'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_lseek_r':
filer.c:142: undefined reference to `lseek'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_read_r':
filer.c:184: undefined reference to `read'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_write_r':
filer.c:226: undefined reference to `write'
/usr/local/m68k-coff/lib/libc.a(fstatr.o): In function `_fstat_r':
fstatr.c:61: undefined reference to `fstat'
--------------------------------------------------------------------------------
Depending upon the target, system calls are not built into newlib's libc.a. They are too dependent upon the particular target board in use. Libgloss (which comes with newlib net releases) is intended to be the repository of such routines and may either provide them in another library that you must link against or in an object file. For systems that don't have a need for such routines, just stub them out. e.g.
--------------------------------------------------------------------------------
int open (char *f, int flags, ...) { errno = ENOSYS; return -1; }
--------------------------------------------------------------------------------