-2

我正在尝试在 Windows 下编译这个程序(它是一个在软盘中转换可启动代码的程序。我从这里得到了源代码:http ://www.acm.uiuc.edu/sigops/roll_your_own/1.bootstrap.html ) .

首先,我遇到了它没有读取 INI 文件的问题。现在解决了。现在我得到以下规则的段错误:

while(data < end) 

我向应用程序添加了输出,因此应该清楚执行停止的位置:没有“。”被打印出来。我在 Win64 上,使用 Cygwin 工具链。

谢谢!

伊万

4

1 回答 1

2

一个错误是:

size = (int *)lSize;

更好的:

*size = lSize;

功能为:

void *loadfile(char *file, long *size)
...

并在调用上下文中,例如:

long size=0;
char *buffer = loadfile("blah.txt",&size);
if( buffer )
{
  printf("\nstrlen = %lu, fsize = &ld", strlen(buffer), size );
}
于 2010-09-19T19:59:41.590 回答