none
LINK : fatal error LNK1117: syntax error in option "" RRS feed

  • Question

  • Searching online, I've discovered similar LNK1117 errors where the problematic option is actually specified.  According to documentation, an empty option string means:

    "The option was not correctly specified. Make sure you are not using a linker option that is no longer valid in the current version of Visual C++."

    Visual Studio 2008 builds the Release/x64 solution without problems but TFSBuild 2008 is throwing this link error so it doesn't seem like there is really a problem with a linker option.

    Here is a portion of the link command line as shown in Visual Studio 2008:

    /OUT:"D:\tfssrc\CodeRefactoring\Source\Applications\CucumberTestHarness\x64\Release\TestHarness.Cucumber.exe"
    /NOLOGO
    /LIBPATH:"..\..\..\..\Libraries\External\boost\lib\x64"
    /LIBPATH:"..\..\..\..\Libraries\External\CodeJock\Published\lib\vc90x64"
    /LIBPATH:"..\..\..\..\Libraries\External\lib"
    /LIBPATH:"..\..\..\..\Libraries\Published\Native\bfile\Win_x64"
    /MANIFEST
    /MANIFESTFILE:"x64\Release\TestHarness.Cucumber.exe.intermediate.manifest"
    /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
    /NODEFAULTLIB:"lic.lib"
    /NODEFAULTLIB:"libcmt.lib"
    /NODEFAULTLIB:"libcd.lib"
    /NODEFAULTLIB:"libcmtd.lib"
    /NODEFAULTLIB:"msvcrtd.lib"
    /DEBUG
    /PDB:"d:\tfssrc\CodeRefactoring\Source\Applications\CucumberTestHarness\x64\Release\TestHarness.Cucumber.pdb"
    /LTCG
    /DYNAMICBASE
    /NXCOMPAT
    /ERRORREPORT:PROMPT

    The remainder of the command line just references individual libraries.

    The various link options were just default settings when creating a new empty project; we haven't played around with the linker settings.

    All I can think of is that there's a problem with one of the libraries against which we're linking?

    Any ideas of what else to try would be appreciated.  Thank you.

    Friday, May 31, 2013 3:40 PM

Answers

  • On 5/31/2013 11:40 AM, Karim Nogas wrote:

    The remainder of the command line just references individual libraries.

    That's probably where the problem lies. I've seen this once before with an oddly formatted path. If I recall correctly, there was a trailing backslash in the path, which was treated as an escape character when immediately followed by a closing quote (as in "some\path\" ), and then quotes didn't balance properly, so the next path was parsed as if it specified options, and it went all downhill from there.


    Igor Tandetnik


    -- Igor Tandetnik
    • Marked as answer by Karim Nogas Monday, June 3, 2013 10:19 PM
    Friday, May 31, 2013 5:51 PM
  • It turns out the use of macros such as $(OutDir) caused a problem because on our build server, it resolves to a path that includes spaces.  On local workstations this isn't an issue.  The solution is simply to include quotes such as "$(OutDir)\mylibrary.lib".
    • Marked as answer by Karim Nogas Monday, June 3, 2013 10:19 PM
    Monday, June 3, 2013 10:19 PM

All replies

  • On 5/31/2013 11:40 AM, Karim Nogas wrote:

    The remainder of the command line just references individual libraries.

    That's probably where the problem lies. I've seen this once before with an oddly formatted path. If I recall correctly, there was a trailing backslash in the path, which was treated as an escape character when immediately followed by a closing quote (as in "some\path\" ), and then quotes didn't balance properly, so the next path was parsed as if it specified options, and it went all downhill from there.


    Igor Tandetnik


    -- Igor Tandetnik
    • Marked as answer by Karim Nogas Monday, June 3, 2013 10:19 PM
    Friday, May 31, 2013 5:51 PM
  • Thanks for the reply, Igor.  This gives us another area to examine although if the path was poorly formed, wouldn't it have affected the Desktop build as well?  TFSBuild must be doing something differently...

    I'm posting this question on behalf of another developer so it may be a few days before I can mark your reply as an answer or provide more feedback.

    Monday, June 3, 2013 7:16 PM
  • It turns out the use of macros such as $(OutDir) caused a problem because on our build server, it resolves to a path that includes spaces.  On local workstations this isn't an issue.  The solution is simply to include quotes such as "$(OutDir)\mylibrary.lib".
    • Marked as answer by Karim Nogas Monday, June 3, 2013 10:19 PM
    Monday, June 3, 2013 10:19 PM