今天终于体验到了C++Builder的稳定性

dataxdata 2012-07-31 11:22:12
用了一段时间CB2010,感觉还是挺稳定的,还到处去说CB如何稳定,结果今天就遇到了事:
生成单一的文件包,把Dynamic RTL设成false,把Build With Runtime Packages选掉,以前这么做从没出过问题,今天白天还去教别人,结果到了晚上,就出了问题:如果不生成这种单一的可执行文件,编译、连接、运行都没问题,一旦要生成单一文件,就出来一大堆连接错误:
[ILINK32 Warning] Warning: BSS : 0x00000000 / 0x00800000
[ILINK32 Warning] Warning: CODE : 0x000472ef / 0x00800000
[ILINK32 Warning] Warning: DATA : 0x00031790 / 0x00800000
[ILINK32 Warning] Warning: DEBNAM : 0x0012761c / 0x00800000
[ILINK32 Warning] Warning: DEBSYM : 0x00040d68 / 0x00800000
[ILINK32 Warning] Warning: DEBTYP : 0x00210e04 / 0x00800000
[ILINK32 Warning] Warning: Extdef flags : 0x00000413 / 0x00004000
[ILINK32 Warning] Warning: Extdefs : 0x0000104c / 0x00004000
[ILINK32 Warning] Warning: External types : 0x000008f0 / 0x00040000
[ILINK32 Warning] Warning: Import symbols : 0x0000030c / 0x00100000
[ILINK32 Warning] Warning: Line number cache : 0x00014172 / 0x00060000
[ILINK32 Warning] Warning: OBJ symbols : 0x000a0cc8 / 0x00100000
[ILINK32 Warning] Warning: Public GSX : 0x0000c5e4 / 0x000c0000
[ILINK32 Warning] Warning: Public types : 0x00014d48 / 0x00080000
[ILINK32 Warning] Warning: Publics : 0x0006f504 / 0x000c0000
[ILINK32 Warning] Warning: SegRelocs : 0x0005986c / 0x00800000
[ILINK32 Warning] Warning: StringBlock : 0x000005be / 0x00800000
[ILINK32 Warning] Warning: TLS : 0x0000009c / 0x00800000
[ILINK32 Warning] Warning: Type names : 0x00034fda / 0x00100000
[ILINK32 Warning] Warning: UNKNOWN : 0x00000018 / 0x00800000
[ILINK32 Warning] Warning: Virdefs : 0x0000c5e4 / 0x00020000
[ILINK32 Warning] Warning: D:/source/Test.ilc: 0x003a0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ild: 0x000c0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ilf: 0x005f0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ils: 0x00990000 / 0x03000000
[ILINK32 Warning] Warning: D:/source/Test.tds: 0x010e0000 / 0x08000000
[ILINK32 Warning] Warning: unknown heap name : 0x08000000 / 0x08000000
[ILINK32 Warning] Warning: Error detected (PE972)
[ILINK32 Warning] Warning: Unable to perform incremental link - performing full link...
[ILINK32 Warning] Warning: BSS : 0x00000000 / 0x00800000
[ILINK32 Warning] Warning: CODE : 0x000472ef / 0x00800000
[ILINK32 Warning] Warning: D:/source/Test.ilc: 0x003a0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ild: 0x000c0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ilf: 0x005f0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ils: 0x00990000 / 0x03000000
[ILINK32 Warning] Warning: D:/source/Test.tds: 0x010e0000 / 0x08000000
[ILINK32 Warning] Warning: DATA : 0x00031790 / 0x00800000
[ILINK32 Warning] Warning: DEBNAM : 0x0012761c / 0x00800000
[ILINK32 Warning] Warning: DEBSYM : 0x00040d68 / 0x00800000
[ILINK32 Warning] Warning: DEBTYP : 0x00210e04 / 0x00800000
[ILINK32 Warning] Warning: Extdef flags : 0x00000413 / 0x00004000
[ILINK32 Warning] Warning: Extdefs : 0x0000104c / 0x00004000
[ILINK32 Warning] Warning: External types : 0x000008f0 / 0x00040000
[ILINK32 Warning] Warning: Import symbols : 0x0000030c / 0x00100000
[ILINK32 Warning] Warning: Line number cache : 0x00014172 / 0x00060000
[ILINK32 Warning] Warning: OBJ symbols : 0x000a0cc8 / 0x00100000
[ILINK32 Warning] Warning: Public GSX : 0x0000c5e4 / 0x000c0000
[ILINK32 Warning] Warning: Public types : 0x00014d48 / 0x00080000
[ILINK32 Warning] Warning: Publics : 0x0006f504 / 0x000c0000
[ILINK32 Warning] Warning: SegRelocs : 0x0005986c / 0x00800000
[ILINK32 Warning] Warning: StringBlock : 0x000005be / 0x00800000
[ILINK32 Warning] Warning: TLS : 0x0000009c / 0x00800000
[ILINK32 Warning] Warning: Type names : 0x00034fda / 0x00100000
[ILINK32 Warning] Warning: UNKNOWN : 0x00000018 / 0x00800000
[ILINK32 Warning] Warning: Virdefs : 0x0000c5e4 / 0x00020000
[ILINK32 Warning] Warning: unknown heap name : 0x08000000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ilc: 0x003a0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ild: 0x000c0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ilf: 0x005f0000 / 0x08000000
[ILINK32 Warning] Warning: D:/source/Test.ils: 0x00990000 / 0x03000000
[ILINK32 Warning] Warning: D:/source/Test.tds: 0x010e0000 / 0x08000000
[ILINK32 Warning] Warning: unknown heap name : 0x08000000 / 0x08000000
[ILINK32 Warning] Warning: Error detected (PE972)
[ILINK32 Error] Error: Unable to perform link
Failed

怎么回事?
...全文
519 21 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
dataxdata 2012-08-02
  • 打赏
  • 举报
回复
[Quote=引用 17 楼 的回复:]

有没有试过自己用implib从shell32.dll中导出一个shell32.lib,替换掉原来的文件?
[/Quote]
上面的那个链接中,有人用过自己implib的方法,但好象还是不行,如果动态调用Shell32.dll就没问题,用vc封装一下也可以
ccrun.com 2012-08-02
  • 打赏
  • 举报
回复
有没有试过自己用implib从shell32.dll中导出一个shell32.lib,替换掉原来的文件?
dataxdata 2012-08-02
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 的回复:]

CB自带的shell32.lib不是bcb推荐使用的,谨慎点的话可以自己调用api来实现。
[/Quote]
就是直接调用API,在连接的时候,如果选用静态连接(选掉Runtime Package),就会连接到CB自带的Shell32.lib上
我不懂电脑 2012-08-02
  • 打赏
  • 举报
回复
CB自带的shell32.lib不是bcb推荐使用的,谨慎点的话可以自己调用api来实现。
勉励前行 2012-08-02
  • 打赏
  • 举报
回复
从来没觉得BCB的IDE稳定过,特别是调试时。虽然有不少毛病,但还能用,这就够了。
软件都是人做出来的,当你发现别人的错误时,直接友好地指出来就好了。同是软件人,我们也不希望别人用自己做的软件时,给个差评,说得一无是处。
dataxdata 2012-08-02
  • 打赏
  • 举报
回复
[Quote=引用 19 楼 的回复:]

刚才重现了楼主的问题,和我以前编的一个Shell组件对比,无意中发现了一个解决方法,在你的程序中生成一个TOpenDialog的实例,连接就完全成功了。以前纯属侥幸,使用了TOpenDialog。

呵呵,很奇怪,看TOpenDialog的构造函数好像也没做什么呀。
[/Quote]
嗯,这也是一个办法
fxworld 2012-08-02
  • 打赏
  • 举报
回复
刚才重现了楼主的问题,和我以前编的一个Shell组件对比,无意中发现了一个解决方法,在你的程序中生成一个TOpenDialog的实例,连接就完全成功了。以前纯属侥幸,使用了TOpenDialog。

呵呵,很奇怪,看TOpenDialog的构造函数好像也没做什么呀。
fxworld 2012-08-01
  • 打赏
  • 举报
回复
不过奇怪的是我自己做的一个TShellControl组件,好多Shell函数都用到了,在2010下用的好好的,没有什么问题,很奇怪,呵呵。
fxworld 2012-08-01
  • 打赏
  • 举报
回复

pe972这个地方有详细讨论,的确是Shell函数调用引起的,难道这是个Bug?

https://forums.embarcadero.com/message.jspa?messageID=218301
dataxdata 2012-08-01
  • 打赏
  • 举报
回复
问题解决了,用一个自己写的函数替换掉SHCreateDirectoryEx函数,就一切正常了
dataxdata 2012-08-01
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]

警告多点,算不上错误,和稳定性无关,可以在options中设置关闭一些警告选项。
[/Quote]
你往下面看,是连接根本就通不过,上面的那些警告只不过是铺垫
fxworld 2012-08-01
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 的回复:]

有个笑话说是我是程序员,不关心waring有多少
[/Quote]

不是说不关心warning有多少,程序员只能够做到对自己的代码负责,如果是自己的代码引起的warning,这个好办,改掉就行了,如果是编译器、连接器因其它原因产生的warning,程序员自己常常是无能为力。也只能看这些warning是否对程序的质量有影响,如果没有影响,直接ignore掉就行了。
缘中人 2012-08-01
  • 打赏
  • 举报
回复
有个笑话说是我是程序员,不关心waring有多少
fxworld 2012-08-01
  • 打赏
  • 举报
回复
警告多点,算不上错误,和稳定性无关,可以在options中设置关闭一些警告选项。
dataxdata 2012-08-01
  • 打赏
  • 举报
回复
今天接着调试,发现一个问题,只要工程中使用了SHCreateDirectoryEx函数,就会出现上述现象
ccrun.com 2012-08-01
  • 打赏
  • 举报
回复
这也算作是工程配置改变,所以最好是 Clean 一下工程,重新编译链接。
缘中人 2012-08-01
  • 打赏
  • 举报
回复
2010没在正式项目中用,路径的问题吧
xjjiang 2012-08-01
  • 打赏
  • 举报
回复
你这个问题不能说明BCB的稳定性啊,楼主要自己找自己的原因
xjq2003 2012-08-01
  • 打赏
  • 举报
回复
builde all projects
fxworld 2012-08-01
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 的回复:]

最终的解决方案是当以后用到Shell32的函数时,就用VC封装一下再使用,……
[/Quote]

这个肯定不能作为解决方案,其实好多人并没有遇到这个问题,那个链接里其中有一楼建议建立一个linkset,然后检查一下出错原因,还给出了如何建立linkset的一个链接,可惜这个链接打不开了,你可以尝试了解一下。
加载更多回复(1)

13,870

社区成员

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

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