visual c++ - Unable to compile Microsoft Detours - Stack Overflow

admin2025-04-16  6

I cloned the lates Microsoft Detours and try to compile in Visual Studio:

1>LINK : warning LNK4281: undesirable base address 0x7100000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x7200000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x7300000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x1900000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x1A00000 for x64 image; set base address above 4GB for best ASLR optimization
1>error CS1668 : Warning as error : Invalid search path 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\atlmfc\lib\x64' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
1>NMAKE : fatal error U1077: 'C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\csc.EXE' : return code '0x1'
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: The command "SET DETOURS_TARGET_PROCESSOR=x64
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: cd ..
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: nmake clean
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: nmake" exited with code 2.
1>    5 Warning(s)
1>    5 Error(s)

The folder referred to 14.29.30133 does not have a atlmfc sub folder on my PC. But these two folders do:

  • 14.39.33519
  • 14.42.34433

I can't workout where to change this in the IDE.

I cloned the lates Microsoft Detours and try to compile in Visual Studio:

1>LINK : warning LNK4281: undesirable base address 0x7100000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x7200000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x7300000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x1900000 for x64 image; set base address above 4GB for best ASLR optimization
1>LINK : warning LNK4281: undesirable base address 0x1A00000 for x64 image; set base address above 4GB for best ASLR optimization
1>error CS1668 : Warning as error : Invalid search path 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\atlmfc\lib\x64' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
1>NMAKE : fatal error U1077: 'C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\csc.EXE' : return code '0x1'
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: The command "SET DETOURS_TARGET_PROCESSOR=x64
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: cd ..
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: nmake clean
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(54,5): error MSB3073: nmake" exited with code 2.
1>    5 Warning(s)
1>    5 Error(s)

The folder referred to 14.29.30133 does not have a atlmfc sub folder on my PC. But these two folders do:

  • 14.39.33519
  • 14.42.34433

I can't workout where to change this in the IDE.

Share Improve this question asked Feb 3 at 13:52 Andrew TruckleAndrew Truckle 19.3k17 gold badges85 silver badges220 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I edited the vcxproj file and replaced:

<PlatformToolset>v142</PlatformToolset>

with

<PlatformToolset>v143</PlatformToolset>

Now it compiles with no errors.

转载请注明原文地址:http://www.anycun.com/QandA/1744767732a87342.html