1

i want to build c ++ library "botan" according to this instruction: https://botan.randombit.net/handbook/building.html (for Windows)

the second command is this: nmake.

in the result I get 'nmake' is not recognized as an internal or external command

After i tried to open nmake.exe, ended up getting this result: cl /DBOTAN_DLL=__declspec(dllexport) /EHs /GR /D_WIN32_WINNT=0x0600 /MD /bigobj /O2 /Oi -DBOTAN_IS_BEING_BUILT /W4 /wd4250 /wd4251 /wd4275 /wd4127 /Ibuild\include /Ibuild\include\external /nologo /c C:/botan/botan/Botan-2.17.2/src/lib/asn1/alg_id.cpp /Fobuild\obj\lib\asn1_alg_id.obj

'cl' is not recognized as an internal or external command

NMAKE : fatal error U1077: cl : returned code "0x1"

Stop.

Question: how can I connect nmake, or how to build a botan library?

qwe
  • 15
  • 1
  • 4
  • What compiler are you using on Windows? What shell are you using ? `nmake` is a rather primitive tool, but it's still included in some Visual Studio installs. – MSalters Nov 26 '20 at 09:23
  • I use cmd, when I run nmake.exe I still get the following message in response 'cl' is not recognized as an internal or external command, – qwe Nov 26 '20 at 09:26

1 Answers1

4

The build instructions assume nmake is somewhere on the PATH. If you run a random cmd shell, this probably won't be the case. Furthermore, nmake assumes the other executables will also be on the PATH.

With Visual Studio, there's a Visual Studio Command Prompt. This is a batch file in the installation folder. Running this will set the PATH to that specific Visual Studio install. As a result, you can run the nmake belonging to that Visual Studio install.

MSalters
  • 173,980
  • 10
  • 155
  • 350
  • I can find out how this file is called, approximately? – qwe Nov 26 '20 at 09:38
  • @unwx: In Visual Studio 2019 it's vsdevcmd.bat from e.g. `c:\program files (x86)\microsoft visual studio\2019\community\Common7\Tools` (or Enterprise etc - you can have multiple parallel Visual Studio installs) – MSalters Nov 26 '20 at 09:40
  • 3
    If you ARE using the Visual Studio Command Prompt and still getting this message, you probably don't have it included as a component in your Visual Studio install. Go to your Visual Studio Installer -> Modify -> Individual Components tab. Under Compliers, build tools, and runtimes, check "MSVC v142 - VS 2019 C++ x64x/x86 build tools (Latest)" and possibly also "C++/CLI support for v142 build tools (Latest)" – Chad Hedgcock Sep 24 '21 at 15:27
  • @ChadHedgcock Installed these exact files and ran `VsDevCmd.bat` per the exact comment (2019 VSC), still no good, Windows 10. – OverLordGoldDragon Oct 06 '22 at 02:39