Linker Tools Error LNK1107
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Linker Tools Error LNK1107.
invalid or corrupt file: cannot read at location
The tool could not read the file. Recreate the file.
LNK1107 could also occur if you attempt to pass a module (.dll or .netmodule extension created with /clr:noAssembly or /NOASSEMBLY) to the linker; pass the .obj file instead.
If you compile the following sample:
// LNK1107.cpp
// compile with: /clr /LD
public ref class MyClass {
public:
void Test(){}
};
and then specify link LNK1107.dll on the command line, you will get LNK1107. To resolve the error, specify link LNK1107.obj instead.
Show: