'MSB6001 Invalid command line switch for "link.exe"
I import functions from my dll everything worked fine until I wanted to use a def file. Now I get this error: MSB6001 Invalid command line switch for "link.exe". System.ArgumentOutOfRangeException: Length cannot be less than zero.
I used to get LNK1104 error but after I used collons in my Additional Dependencies I get the error above.
Post-Build Events > Command Line here I got the following: xcopy /y /d "..\..\HookLibrary\$(IntDir)HookLibrary.dll" "$(OutDir)"
Additional depencies: "HookLibrary.lib;%(AdditionalDependencies)"
Linker > Command Line (while configuration = debug): /OUT:"C:\Users\yigit\Desktop\Hook\HookClient\x64\Debug\HookClient.exe" /MANIFEST /NXCOMPAT /PDB:"C:\Users\yigit\Desktop\Hook\HookClient\x64\Debug\HookClient.pdb" /DYNAMICBASE "HookLibrary.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEF:"HookDef.def" /DEBUG /MACHINE:X64 /INCREMENTAL /PGD:"C:\Users\yigit\Desktop\Hook\HookClient\x64\Debug\HookClient.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Debug\HookClient.exe.intermediate.manifest" /LTCGOUT:"x64\Debug\HookClient.iobj" /ERRORREPORT:PROMPT /ILK:"x64\Debug\HookClient.ilk" /NOLOGO /LIBPATH:"....\HookLibrary\x64\Debug" /TLBID:1
Linker > Command Line (while configuration = release): /OUT:"C:\Users\yigit\Desktop\Hook\HookClient\x64\Release\HookClient.exe" /MANIFEST /LTCG:incremental /NXCOMPAT /PDB:"C:\Users\yigit\Desktop\Hook\HookClient\x64\Release\HookClient.pdb" /DYNAMICBASE "HookLibrary.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEF:"HookDef.def" /DEBUG /MACHINE:X64 /OPT:REF /INCREMENTAL:NO /PGD:"C:\Users\yigit\Desktop\Hook\HookClient\x64\Release\HookClient.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Release\HookClient.exe.intermediate.manifest" /LTCGOUT:"x64\Release\HookClient.iobj" /OPT:ICF /ERRORREPORT:PROMPT /ILK:"x64\Release\HookClient.ilk" /NOLOGO /LIBPATH:"....\HookLibrary\x64\Release" /TLBID:1
My additional dependecies are correct. What am I doing wrong?
Solution 1:[1]
Use semicolons ; to separate files in Additional Dependencies or better select <Edit...> and fill dependecies line by line.
Linker command line can be verified under Linker->Command Line.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


