I am getting error Error C1007 unrecognized flag '-Ot' in 'p2' but unable to find -Ot in the command line string of the project. Googling did not help. Anyone know what does that flag stand for ?
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- Calling a .Net Framework 4 (or Mono) assembly from
- “Csc.exe” exited with code -1073741819
You should find this flag in the Optimization property page of your project.
-Ot (/Ot) option is the Favor Fast Code flag (Attempts to offer improvements in execution time over space)
According to the Microsoft Visual C++ Documentation (https://docs.microsoft.com/en-us/cpp/build/reference/os-ot-favor-small-code-favor-fast-code),
Happened to me while building nmap. Executables did not have /GL, while libnetutil did. Removing /GL from libnetutil fixed it. Or, if possible (and desired), align /GL to all dependent targets (lib, dll/exe).
Just for future reference to this error msg: I got this error with no -Ot option set, the error message was misleading. Turned out that I tried to build a project with a 140 toolset (VS2015 - forgot to upgrade to 141) with .dll and .lib dependencies already built with 141 (VS2017). After updating the toolset to 141 the project could be built.
I had a similar issue on a project that I was compiling. It seems to be caused when MSVC 2017 linker tries to link a dependency library ".lib" to your project and it was compiled with Optimization flag
/Ot
enabled. That is why you can not see it on command line of your own project. You can try one of these actions./Ot
enabled (Properties → C/C++ → Optimization → Favor Size or Speed → Neither), then recompile whole project./Ot
enabled.Both solutions worked in my case, but I ended up using number 2.