Checking for msvc C++ compiler - Could not find the program ['MT']

2,400 views
Skip to first unread message

Haz AUT

unread,
Dec 22, 2017, 4:00:28 AM12/22/17
to steinwurf-dev
Hello Guys,

I am trying to build kodo_rlnc with your build system. I have installed all required download tools for Windows 10 including Visual Studio Community 2015, python 2.7, Git. However, When I have used python waf configure command, I got the following message once be checking for 'msvc' C++ compiler: Could not find the program ['MT']. after that it showed "Configure finished successfully". You may find the config.log file attached. I did make sure that I have c++ compiler on the system and I have set the environment variables required.

Once I tried to build it, waf left the building directory and showed "Build failed".:  -> task in 'udp_file_sender' failed with exit status 1 (run with -v to display more information)  -> task in 'udp_receiver' failed with exit status 1 (run with -v to display more information).

I would appreciate any helpful information. 

Thank you for your attention.

Best Regards,
Hazim

  
config.log

Péter Vingelmann

unread,
Dec 22, 2017, 10:15:31 AM12/22/17
to Haz AUT, steinwurf-dev
Hello,

The first issue is that you are trying to configure with Python 3.x and that is not supported on Windows. Python 2.7 should give you better results.

The config.log shows the following error:
ERROR: Cannot determine the location of the VS Common Tools folder.

So checking for msvc fails, then it tries to find g++ on your system! (which is available in your PATH: C:\\Program Files\\Haskell Platform\\8.0.1\\mingw\\bin\\g++.exe)

Check your environment variables, you should have something like this for VS 2015:
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\

If that does not help, then you are missing some VS keys in the registry. You can try to reinstall VS 2015, and make sure that you have *only one* VS version installed.
Unfortunately, the registry is not cleaned properly when older versions are uninstalled, so it might need some manual clean-up.

Cheers,
Peter

--
You received this message because you are subscribed to the Google Groups "steinwurf-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Péter Vingelmann

unread,
Dec 22, 2017, 10:54:22 AM12/22/17
to Haz AUT, steinwurf-dev
Perhaps you can easily solve the missing 'MT.exe' issue if you find the binary on your system, then add the corresponding folder to your PATH.
The possible locations are something like this (it does not matter which version you find):

C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86\\MT.exe
C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x86\\MT.exe

If you don't have this binary on your system, then try to install the Windows 10 SDK:

To be honest, the Visual Studio installer should take care of this. It is really surprising if the binary is missing for you.

Haz AUT

unread,
Dec 24, 2017, 9:34:46 PM12/24/17
to steinwurf-dev
Hi Peter,

Thank you very much for your time and effort.

First, I have uninstall VS2013 and I have checked the environment variables and the "VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\" is exist. I have also added "MT.exe" for USER VARIABLES (right?). Then, I used python 2.7 to configure. However, I still got the same errors.

It is clear that the problem is with the VS. I have install/uninstall it many times using a tool that is expected to provide a full un-installation.

Is there any option to configure without VS? I have read that only VS is available for windows. Is that right?

Thank you very much.

Best Regards,
Hazim    
To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-de...@googlegroups.com.

Péter Vingelmann

unread,
Dec 25, 2017, 10:57:21 AM12/25/17
to Haz AUT, steinwurf-dev
It seems that the problem is not VS itself, but the missing MT.exe.
Its location can be unpredictable on Windows 10, and that's a problem when configuring VS 2015.
Did you find this binary on your machine?

For example, if you have it here:
C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86\\MT.exe

Then the following folder should be added to your PATH (this must be the *folder*, not the exe file itself):
C:\Program Files (x86)\Windows Kits\10\\bin\x86

Most likely, you have the file at a different location, just search for it!


And yes, VS 2015 is the only supported compiler for Windows.

To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-dev+unsubscribe@googlegroups.com.

Haz AUT

unread,
Dec 26, 2017, 1:10:22 AM12/26/17
to steinwurf-dev
Hi Peter,

That was helpful. It is fine for the configuration right now. However, the config file still shows the error: Cannot determine the location of the VS Common Tools folder. Once I try to build, the following error appears :  fatal error C1083: Cannot open include file: 'cstdint': No such file or directory. Then the build failed. it is noteworthy that the variable "VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\" is exist under system variables. 

I would appreciate any suggestions to solve this error.

Thank you for your cooperation.

Best Regards,
Hazim

Péter Vingelmann

unread,
Dec 27, 2017, 10:32:07 AM12/27/17
to Haz AUT, steinwurf-dev
The missing 'cstdint' header is usually a sign of an incomplete compiler installation.
So are you saying that you found MT.exe on your system and added the corresponding folder to your PATH?
If that's the case, then we should look at your config.log again to see the changes. Can you share the file?

To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-dev+unsubscribe@googlegroups.com.

Haz AUT

unread,
Dec 28, 2017, 1:35:52 AM12/28/17
to steinwurf-dev
Hi Peter,

Yes, I have found MT.exe and added it to the PATH. Then the configuration finished successfully. However, Cannot build the project because of the error shown in previous post.

Please find attached the config.log.   

Thank you very much.

Regards,
Hazim
config.log

Péter Vingelmann

unread,
Dec 28, 2017, 10:34:40 AM12/28/17
to Haz AUT, steinwurf-dev
Your config.log looks perfect, I don't see any issues here.

Just to be sure, can you check if you have the missing cstdint header file?
It should be here: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cstdint

You can also try to compile some C++ example code with VS itself, not using waf or any of our tools. 
If you cannot compile anything, then VS is broken, maybe the installation was not finished properly.

To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-dev+unsubscribe@googlegroups.com.

Haz AUT

unread,
Dec 29, 2017, 9:46:45 PM12/29/17
to steinwurf-dev
Hi Peter,

I do have the cstdint file under C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include. Also, I have tried some simple c++ examples (including cstdint file) with VS and they correctly compiled. However, The same error still appears once I try to build.

I would appreciate any other possible causes for this error.

Thank you,
Hazim

Péter Vingelmann

unread,
Dec 30, 2017, 8:41:21 PM12/30/17
to Haz AUT, steinwurf-dev
OK, so VS has the correct includes, but it fails to communicate the include paths to waf. The "INCLUDE=" line in your config.log shows this issue. To be honest, the configure step should fail if the include paths are missing.

I think waf tries the 64-bit VS toolchain first and that seems to be problematic on your system, so you can try to directly configure the native 32-bit toolchain using this mkspec:

python waf configure --cxx_mkspec=cxx_msvc14_x86

At least, you can expect some different results with this mkspec!

Perhaps waf is not fully compatible with the Community Edition of VS2015, so you might have better luck with "Visual Studio Express 2015 for Windows Desktop" if everything else fails.

To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-dev+unsubscribe@googlegroups.com.

Haz AUT

unread,
Dec 31, 2017, 7:45:05 PM12/31/17
to steinwurf-dev
Hi Peter,

I have tried both and still got the same errors. Find attached the config.log files for each try. However, even when I check the VS2015 itself I got the error message "Cannot determine the location of the VS Common Tools folder". it seems that there is a problem with VS2015 both community and express for windows desktop editions.I am tiring to figure out what's the problem.


Thank you very much.

Best Regards,
Hazim      


config.log
config.log

Péter Vingelmann

unread,
Dec 31, 2017, 9:37:29 PM12/31/17
to Haz AUT, steinwurf-dev
I have one more suggestion to alleviate the confusion. 

Please remove the following entries from your PATH:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;

Please keep this one for now (perhaps this can be removed as well):
C:\Program Files (x86)\Windows Kits\10\bin\x86

It is recommended to reboot the system after changing the PATH, or you can just open a brand new terminal window and check if your changes are applied.


I think it is very confusing for waf if it finds CL.exe even when waf-print-msvc-1.bat fails. 
That's why we don't recommend manually adding any VS folders to your PATH, I just noticed that you did that.


To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-dev+unsubscribe@googlegroups.com.

Haz AUT

unread,
Jan 1, 2018, 2:11:54 AM1/1/18
to steinwurf-dev
Hi Peter,

I have added these entries to overcome the following error during the configuration: msvc: Impossible to find a valid architecture for building ['msvc 14.0'] - ['msvc 14.0']. That is, without these entries, It cannot find the msvc. Please find attached the config.log file.

Thank you very much.

Best Regards,
Hazim   

config.log

Péter Vingelmann

unread,
Jan 1, 2018, 1:14:02 PM1/1/18
to Haz AUT, steinwurf-dev
You should never have to add these entries manually. You only add confusion with this and you mask the underlying problem.

I just googled your actual issue: "Cannot determine the location of the VS Common Tools folder."
This question shows the potential problems for VS2010, but it's the same thing for VS2015:
The error occurs in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat (which initializes the VS Command Prompt) and it has nothing to do with our tools.

You can open the shortcut in Start Menu\Programs\Visual Studio 2015\Visual Studio Tools\Windows Desktop Command Prompts\VS2015 x86 Native Tools Command Prompt
and you should get the same error message.
If you can fix this error, then our tools should also work fine (waf uses the same VS Command Prompt to determine the correct configuration).


I think you should read the suggestions at the StackOverflow question, there could be many issues behind this.

The first thing to check is the following registry key (just open a Windows Command Prompt and type this command):

reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "14.0"

You should get the following output if the registry key is correct:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7
    14.0    REG_SZ    C:\Program Files (x86)\Microsoft Visual Studio 14.0\

If you don't get this value, then you can add/modify it manually using regedit.

vcvars32.bat runs the same command to find the VS Common Tools folder, so you can fix all your problems if you can make this work.



To unsubscribe from this group and stop receiving emails from it, send an email to steinwurf-dev+unsubscribe@googlegroups.com.

Haz AUT

unread,
Jan 1, 2018, 8:54:48 PM1/1/18
to steinwurf-dev
Hi Peter,

I will make sure first that the VS is correctly installed. I do not have full access to the registry, So I should contact the IT to manage that.

Thank you very much for your valuable comments. I really appreciate you efforts and patience. 

Happy New Year.

Best Regards,
Hazim 
Reply all
Reply to author
Forward
0 new messages