Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DEF file syntax error in visual studio 2012

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

like image 625
S_R Avatar asked Nov 16 '13 18:11

S_R


1 Answers

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.

like image 106
Hans Passant Avatar answered Sep 19 '22 17:09

Hans Passant