Adam
Adam

Reputation: 10016

"'m164' is not recognized as an internal or external command", building OpenSSL using VS 2013 Developer Command Prompt

I'm following the guide to building OpenSSL for Visual Studio here: http://developer.covenanteyes.com/building-openssl-for-visual-studio/

Apparently all I need is the latest version of the OpenSSL source code, Active Perl or Strawberry Perl, and Visual Studio 2010. I'm using 2013, but I thought I'd give it a try anyways. When I get to the nmake command, I get the error shown in the screenshot below:

enter image description here

I guess this is because I'm using VS 2013 instead of 2010? Does anyone know of a way to correct this issue, or does anyone know of a guide I can use to get OpenSSL working in VS 2013? I'm using Windows 7 64 bit.

Upvotes: 0

Views: 1148

Answers (3)

Shenk
Shenk

Reputation: 411

Part 1 of the answer by @PazO helped me eventually figure out a solution to this problem, while the answer by @Hugh helped me figure out what was wrong in the first place.

The root problem here is that you should not be looking for "m164.exe" but instead "ml64.exe". Note the lowercase L instead of the number 1.

The link in the question is no longer available, so I don't know whether the typo was in another library or created manually, but fixing that should theoretically solve that issue in that scenario.

The following is additional information I think might be useful to others receiving this same message.

Now for getting your environment set up correctly from the start. If you have installed Visual Studio, I do not know from which version it started doing this, but it puts shortcuts into your start menu for launching a console with the environment pre-configured.

For the following, replace [YEAR] with the installed version of Visual Studio, such as 2019.

There is a generalized developer console with this environment for command prompt or powershell, respectively titled Developer Command Prompt for VS [YEAR] and Developer PowerShell for VS [YEAR].

The shortcuts folder can be found by opening Run and executing shell:common start menu, then navigating to Programs\Visual Studio [YEAR]\Visual Studio Tools\VC\. Alternatively, the full path will be like %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Visual Studio [YEAR]\Visual Studio Tools\VC\. In this directory are shortcuts for specific architectures (that end up running the respective vcvars .bat file). Additionally, the folder above this holds the "Developer" consoles mentioned in the previous paragraph.

For completion's sake, those vcvars .bat files can—as of now in the Community version of Visual Studio—similarly be found in the %ProgramFiles(x86)%\Microsoft Visual Studio\[YEAR]\Community\Auxiliary\Build\ directory.

Upvotes: 0

PazO
PazO

Reputation: 1486

Here what worked for me:
Apparently this issue was caused on my side because of missing environment variables settings. Per OpenSSL documentation I installed Microsft Platform SDK, and in addition, on my machine I have Microsoft Visual Studio 2013, but still had to setup the evironment variables, as described below:

  1. Set environment variable for Visual-Studio (2013 in my case) by running the vcvars64.bat batch file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat
  2. [OPTIONAL]
    On my machine the condition was that some of the binaries where already built, but with the wrong environment variables, so I first had to thoroughly clean the build environment by running the following command:
    nmake -f ms\ntdll.mak reallyclean
  3. Then I re-started the build process as described by the INSTALL.W64 file:
    1. perl Configure VC-WIN64A
    2. ms\do_win64a
    3. nmake -f ms\ntdll.mak
    4. cd out32dll
    5. ..\ms\test


After this all was working!

Upvotes: 1

Hugh
Hugh

Reputation: 16

I got the same error 6/26/16. Apparently m164.exe is an assembler on AMD boards (I'm using Intel, where it is ml.exe). I was unable to work around it. But the 32 bit version doesn't have the same problem.

Upvotes: 0

Related Questions