Visual Studio 2012中的DEF文件语法错误

Visual Studio 2012中的DEF文件语法错误

问题描述:

我有一个vs项目,升级到Visual Studio 2012后将无法编译. 它是一个win32 dll项目,它抱怨def文件. 这是def文件

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

这是我在Visual Studio 2012 Ultimate中编译项目时遇到的错误.

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

令我感到困惑的是,这在Visual Studio 2008& amp; 2010.

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

你知道这里出了什么问题吗?

Any idea what is going wrong here?

谢谢 苏尼尔

版本3.1.4.1

VERSION 3.1.4.1

DEF文件为.回顾过去,程序员只需要两个版本号,主要版本和次要版本.添加修订和内部版本号的想法是由经理而非程序员想到的.一个 build 数字,wtf?

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?

您必须满足VERSION 3.1的条件.是的,这个错误很长一段时间以来都被默默地忽略了.经理终于发现了:)

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 :)

改为使用版本资源