问题
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