大家来讨论一下这个错误:[Linker Error] Unresolved external '__linkproc__ intover' referenced from ****.obj,参与即有分

lynu 2001-12-10 11:15:23
[Linker Error] Unresolved external '__linkproc__ intover' referenced from
***.obj
...全文
492 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lynu 2001-12-10
  • 打赏
  • 举报
回复
如果发生这个错误的时候,即使你编译一个空的工程,这个错误同样发生.
如果说是第三方控件的问题。我告诉你:如果你重装cb5,编译原来的工程,有可能能够通得过.
我此次测试的时候,同一个工程未作任何改变,在一个系统下编译成功,另一个失败.
下面是borland新闻组上关于此问题的讨论.

Hi Mike,

What is there to say but, Thank you , Thank you, Thank you, from the
very bottom of my soul !!!.

Lachlan MacColl



>Hi - in the thread "Unresolved references and internal error..." I gave this
>response to the question about the __linkproc__ intover bug in Borland, I
>have also included the comment from Ed Mulroy about the workaround.
>
>^__^
>Mike
>
>----
>My original post:
>---
>
>Hi,
>
>I might have some input to the linkproc _intover_ problem you have seen, I
>can not explain why the compiler sometimes generate this error, but I can
>tell you what happens... And give you a solution that will remove the error
>in the future...
>If you have a function like :
>
>int foo(int a, int b)
>
>{
>
> return a+b;
>
>}
>
>
>
>The Borland compiler will generate code like this:
>
> _foo push ebp
> mov ebp,esp
> mov eax,+8H[ebp]
> add eax,+0cH[ebp]
> pop ebp
> ret
>
>But for some obscure reason sometimes it generate code like this:
>
>_foo push ebp
> mov ebp,esp
> mov eax,+8H[ebp]
> add eax,+0cH[ebp]
> jno L1
> call @@intover
>L1 pop ebp
> ret
>
>as you can see, it suddenly calls the @@intover function in case of an
>overflow - but since this is not a function included in the libraries linked
>when generating the exe file we get the linker error.
>
>The way to make the code link anyway is to declare a @@intover function,
>i.e. by including the following code in an *.asm file an add it to your
>project:
>
>
>--------intover.asm begin-------
>
>; This file contains a dummy define of the intover function used to prevent
>; the linkproc _intover_ linker error in Borland builds
>;
>
>
>.586
>.model large
>EXTERNDEF @@intover: FAR
>.code
>
>@@intover PROC FAR
>db 0c3h
>@@intover ENDP
>
>end
>--------intover.asm end-------
>
>It should be noted that it have been seen that the C++ builder environment
>sometimes refuses to generate an .obj file from the above assembler (even it
>assembles it!!) - if you experience that, just make an empty project with
>nothing but the above file in it, make the file, and include the generated
>.obj file into your main project.
>
>Hope it helps :o)
>
>Regards,
>
>Mike K.
>
>---
>Answer from Ed Mulroy:
>---
>
>Clever workaround. I have not confirmed that it works, but can't as I
>haven't had the intover problem. I think you need to use flat instead of
>large for Win32 apps.
>
>Since not all versions of C++ Builder come with TASM32, not all can use that
>source code. I have posted a file, INTOVER.OBJ, in
>borland.public.attachments for those who wish to use it but don't have
>TASM32. The message name is intover.obj Note that an object file can be
>added to a project list. It was built from this source:
>
>--------------------
>.586
>.model flat
>EXTERNDEF @@intover: FAR
>.code
>
>@@intover PROC FAR
>db 0c3h
>@@intover ENDP
>
>end
>--------------------
>
>. Ed
>
>

wxz 2001-12-10
  • 打赏
  • 举报
回复
能否说说你的程序使用了哪些元件造成这类错误?
lynu 2001-12-10
  • 打赏
  • 举报
回复
我说说这个错误,我使用cb有几年了,cb1,cb3,cb4,cb5都用过,这个错误都曾经发生过,我每次除了重装cb,几乎别无他法.
此次我安装了二个系统,都装有cb5和工程所需要的第三方控件,对工程不作任何改动,在其他一个系统编译并链接成功,在另外一个系统上失败并提示上述错误,所以再次证实我以前对此错误的认识:"为cb5自身之问题"
为了解决这个问题,方便所有的cb程序员,此次我登上borland的新闻组,终于是到解决办法.
由于我的E文很差劲,所以说得不清楚的地方,大家可以到borland的c++builder新闻组上看看.

1>这个错误在新闻组上被一些高手视为cb5之"Bug".
2>至于原因,上面E文说了一大堆,由于偶初中毕业,看了半天,大意都没看清楚
3>解决办法,这就是我关心的了:

新建一个asm文件 :intover.asm
;--------intover.asm begin-------

; This file contains a dummy define of the intover function used to prevent
; the linkproc _intover_ linker error in Borland builds

.586
.model flat
EXTERNDEF @@intover: FAR
.code

@@intover PROC FAR
db 0c3h
@@intover ENDP

end

;--------intover.asm end-------

用tasm32编译并生成.obj文件,然后在发生错误的工程文件中添加单元,即生成的intover.obj
必须重新build原工程,我试了用make不行.


luckybat 2001-12-10
  • 打赏
  • 举报
回复
因为vcl是pascal写的,与c++的类型系统不太一致,极少的情况下会出现c++builder连接vcl库例程失败的例子,不得已可单独写一pascal单元去连接,再试着调整输出其他模块想要的c++原型。
若是你程序的错误我想就不用多说了。
heavyrain1234 2001-12-10
  • 打赏
  • 举报
回复
其实,还是你程序的问题
还举个例子,有可能是构造函数也会引起这样的问题
heavyrain1234 2001-12-10
  • 打赏
  • 举报
回复
这个涉及到vcl了,一般是不会这样的
除了某些情况,比如说:你的程序中有能引起link error的地方,举个最间单的例子:
你定义的某个变量,在vcl中有同名的
“错误信息可能不一样”

个人之言,仅供参考,
lynu 2001-12-10
  • 打赏
  • 举报
回复
intover并不是工程所需要的函数,在工程中无任何引用此函数的地方。
而cb5编译一个工程时,有时会需要引用此函数,而有时却不需要,上面的解决办法是制作一个空的intover函数供编译器链接使用.

我以前一直以为cb5的一些内部函数需要一个这样的intover函数,而发生这个错误的原因为因为cb5的一些系统文件发生错误,所以每次都是重装来解决.

而新闻组上所说的“>But for some obscure reason sometimes it generate code like this:",难道是因为安装了第三方控件而导致编译器的编译行为有所改变?

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧