DEF file syntax error in visual studio 2012

不打扰是莪最后的温柔 提交于 2019-11-28 07:40:39

问题


I have a vs project which wouldn't compile once I upgraded to visual studio 2012. Its a win32 dll project and it complains about the def file. This is the def file,

LIBRARY test.dll
VERSION 3.1.4.1
EXPORTS
addNumbers @1

and this is the error I get when I compile the project in visual studio 2012 ultimate.

Source.def(2): fatal error LNK1118: syntax error in 'VERSION' statement

What is confusing me is that, this works perfectly fine with visual studio 2008 & 2010.

Any idea what is going wrong here?

Thanks Sunil


回答1:


VERSION 3.1.4.1

DEF files are old. Back in ye goode olde days, programmers only ever needed two version numbers, major and minor. The idea of adding a revision and build number was conjured by a manager, not a programmer. A build number, wtf?

You'll have to settle for VERSION 3.1. And yes, that mistake got silently ignored for a very long time. Not anymore, the manager finally found out :)

Use a version resource instead.



来源:https://stackoverflow.com/questions/20021950/def-file-syntax-error-in-visual-studio-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!