Home Dashboard Directory Help
Search

LINK : fatal error LNK1117: syntax error in option 'OPT:NOWIN98' by Robert Wishlaw


Status: 

Closed
 as By Design Help for as By Design


0
1
Sign in
to vote
Type: Bug
ID: 475896
Opened: 7/20/2009 9:13:54 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Trying to nmake Scintilla 1.79 generates this error

LINK : fatal error LNK1117: syntax error in option 'OPT:NOWIN98'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x45d'

The command line used is

link /OPT:NOWIN98 /OPT:REF /LTCG /DEBUG -DEF:Scintilla.def -DLL -OUT:..\bin\Scintilla.dll .\AutoComplete.obj .\CallTip.obj .\CellBuffer.obj .\CharClassify.obj .\ContractionState.obj .\Decoration.obj .\Document.obj .\Editor.obj .\Indicator.obj .\KeyMap.obj .\LineMarker.obj .\PlatWin.obj .\PositionCache.obj .\PropSet.obj .\RESearch.obj .\RunStyles.obj .\ScintillaBase.obj .\ScintillaWin.obj .\Style.obj .\UniConversion.obj .\ViewStyle.obj .\XPM.obj .\PerLine.obj .\ScintRes.res KERNEL32.lib USER32.lib GDI32.lib IMM32.lib OLE32.LIB
Details
Sign in to post a comment.
Posted by Robert Wishlaw on 7/29/2009 at 7:36 PM
If you have removed these options from Visual Studio 2010 then somebody had better remove them from the Visual Studio 2010 documentation where they are still listed. Please see

http://msdn.microsoft.com/en-us/library/bxwfs976(VS.100).aspx

where it is stated

Visual Studio 2010 - Visual C++/OPT (Optimizations)

Controls the optimizations that LINK performs during a build.

/OPT:{REF | NOREF}
/OPT:{ICF[=iterations] | NOICF}
/OPT:{WIN98 | NOWIN98}

....

WIN98 | NOWIN98
WIN98 and NOWIN98 control the section alignment in the final image. For Windows 98 applications, it is optimal to align sections on a 4K boundary to improve load time (allows Windows 98 memory manager to cache executable images with a minimum of wasted space). This is on by default in the linker, so you need to specify /OPT:NOWIN98 to get a trimmed-down (but slower on Windows 98) version of the application.

WIN98 is on by default. WIN98 is not on when:

/ALIGN is used.

/MACHINE does not target x86.

/SUBSYSTEM specifies something other than WINDOWS or CONSOLE.

/OPT:WIN98 is not enabled by default for images that would grow (according to the average growth equations, below) by more than 25 percent. In other words, /OPT:WIN98 would not be enabled for smaller images. You should enable /OPT:WIN98 explicitly to ensure that you are not affected by this tuning. Specify /OPT:NOWIN98 to get a smaller (but slower on Windows 98) version of your application.

The enhancements in Windows 98 only work when the sections in a portable executable image begin on a page boundary. The /OPT:WIN98 option performs the necessary file alignment.

If you are building components that run only on Windows NT or Windows 2000, you should use /OPT:NOWIN98.

This change does not impact loading of images or the working set of the process. The only impact is to the on-disk size.

The following helps you compute the average growth of an image using /OPT:WIN98:

The average wasted space for 4096-byte file alignment can be characterized by: count-of-sections-in-image * 4096/2

The average wasted space for the current 512-byte file alignment is: count-of-sections-in-image * 512/2

The growth is therefore:

count-of-bytes-Growth = count-of-sections-in-image * (4096/2 - 512/2)

or, simplified,

count-of-bytes-Growth = count-of-sections-in-image * 1792

However, this does not take into account the fact that the image header must be padded to the section alignment. Since the header is always 512 byes or less, the extra growth is a constant of 4096 - 512, or 3584.

average count-of-bytes-Growth = count-of-sections-in-image * 1792 + 3584

maximum count-of-bytes-Growth = count-of-sections-in-image * (4096 - 512 + 3584

To get the count of sections, use the DUMPBIN tool on an executable file. The summary will give you a list of sections in that image. Typically, you will see from 3 to 5 sections added to that value.

The only time you should not use /OPT:WIN98 is when your portable executable image is very small. Even if an image is slated for downloads, the wasted space is zero-filled and compresses well.

Posted by Microsoft on 7/29/2009 at 6:11 PM
Hello, thanks for your feedback.
From Visual Studio 2008, /OPT:WIN98 and /OPT:NOWIN98 were deprecated, and now we removed these two options from Visual Studio 2010. Sorry for any inconvenience.
Sign in to post a workaround.