小问题,请教大家了.链接时警告:LINK : warning LNK4089: all references to "ODBC32.dll" discarded by /OPT:REF

mybname65319203 2004-07-25 11:19:15
我的程序在F5时,提示找不到MFCD42D.DLL, 不能运行.(拷了一个就好了)
此时程序是Debug,Use MFC in a Shared DLL

我在工程中设为Release, Use MFC in a Static Library
在链接时就出现了下面的提示

LINK : warning LNK4089: all references to "ODBC32.dll" discarded by /OPT:REF

LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF

我查了一下字典,好像是说什么 到 ODBC32.DLL 的引用被 /OPT:REF 抛弃了。


虽然拷了一个MFCD42D.DLL后,程序已可以运行,但静态链接时有上面的警告,不知会对程

序有什么影响?

在那能改掉他呢?(改设置中的警告级别不算)



...全文
225 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
mybname65319203 2004-08-10
  • 打赏
  • 举报
回复
虽然问题没解决,不过再在还不受影响,谢谢大家帮助 , 我给分.
mybname65319203 2004-07-30
  • 打赏
  • 举报
回复
LINK : warning LNK4089: all references to "ODBC32.dll" discarded by /OPT:REF

LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF

1,程序中我用了gethostname()函数,include 'winsock.h' 链接时加了wsock32.lib.上面的警告对我的程序有影响吗, 现在运行没觉出怎么样.

如果不用gethostname(),还有别的方法吗,(从注册表取不算)

2,
/OPT:REF
这是个开关参数吗,在那能看到他呢,Link中吗 VC 的开发环境不太熟,细说一下吧
Kudeet 2004-07-25
  • 打赏
  • 举报
回复
all references to 'dynamic-link library' discarded by /OPT:REF

The linker discarded all packaged functions that referenced exports in dynamic-link library. As a result, dynamic-link library is not needed for execution of the image.

You may want to consider removing references to dynamic-link library to speed up the build.

Other occurrences of this warning can occur if an unused function in your code references a .dll export that the linker has discarded. Use /VERBOSE to see which of your functions the linker is discarding and then remove them from your code.
名牌大灰狼 2004-07-25
  • 打赏
  • 举报
回复
/OPT:REF 已丢弃所有对“动态链接库”的引用

链接器放弃了引用 dynamic-link library 中的导出的所有封装函数。因此,执行图像并不需要 dynamic-link library。

可能需要考虑移除 dynamic-link library 引用以加快生成速度。

如果代码中未使用的函数引用链接器已放弃的 .dll 导出,也可能会出现此警告。使用 /VERBOSE 查看链接器所放弃的函数,然后将它们从代码中移除。

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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