Visual C++ Tips: fatal error LNK1276: invalid directive 'ComMode.Obj' found; does not start with '/'

来源:互联网 发布:windows udp端口测试 编辑:程序博客网 时间:2024/06/05 06:46

问题

将某古老的VC6项目迁移到VS2005,编译时出现这个错误:

fatal error LNK1276: invalid directive ‘ComMode.Obj’ found; does not start with ‘/’

解决

经过广泛搜寻,发现是这样一条语句导致的这个编译错误:

#pragma comment(linker, "ComMode.Obj")

解决方案:把这行代码注释掉(Remark),改在项目属性里面设置:Property Pages | Linker | General | Additional Library Directories
Property Pages | Linker | General | Additional Library Directories

参考文章

  • fatal error LNK1276: does not start with ‘/’
  • MSDN: Link Options
  • MSDN: /LIBPATH (Additional Libpath)
0 0
原创粉丝点击