小弟有点问题向各位高手请教:
详细情况如下:
编译后的目标文件
A.OBJ
int max(int i,int j)
{
   int m;
   m=i;
   if(m<j)m=j;
   return m;
}
我在Delphi中调用上面的文件时出了错怎么回事?
implement
{$L d:\A.OBJ} 
function max(x,y:smallint):smallint;external; 
其它什么也没写了:
编译时出现这样的提示:
[Error]Unit1.pas[21]:Unsatisfied forward or external declaration:'max'
[Fatal Error]Project1.dpr(5):Could not compile used unit 'Unit1.pas'
[Pascal Error]Unit1.pas(1):Unable to invoke Code Completion due to errors in source code
请高手执教

解决方案 »

  1.   

    function max(x,y:smallint):smallint;external; 
    编译期出错。所以应该是这一句有问题。
      

  2.   

    那绝对不是的.我把这句去掉了.但问题依然存在.
    显示
    [Error]Unit1.pas(24):16-Bit segment encountered in object file 'd:\a.obj'
      

  3.   

    换BCB编译咯当然VC不行,虽然是32位的编译器,但obj格式不同
      

  4.   

    嗯.是不是只有Borland 的C才可以啦?
      

  5.   

    怎么还没明白呢?TC也算是"Borland的C"啊,但它是16位编译器