1

recently I have downloaded latest version of mingw for win7 64bit. also i have a program to build with scons but when i try to run it I see "cl is not recognized as an internal or external command" I search on internet and this site they suggest two solutions fist checking environment varible second install this mingw from here

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

but I am sure my environment is true c:\mingw\bin and I have a new version of mingw for win 7 64 bits

I will appreciate any suggestion.

  • Its looking for the windows compiler (cl) and cant find it. – Brady Aug 01 '13 at 17:13
  • possible duplicate of [How to tell scons to use MinGW instead of MSVC](http://stackoverflow.com/questions/13161690/how-to-tell-scons-to-use-mingw-instead-of-msvc) – sashoalm Jul 28 '15 at 09:30

1 Answers1

2

As I mentioned in the comment to your question, its looking for the Windows compiler, which you probably dont have installed. According to the SCons man page, you can fix this as follows:

MinGW

The MinGW bin directory must be in your PATH environment variable or the PATH variable under the ENV construction variable for SCons to detect and use the MinGW tools. When running under the native Windows Python interpreter, SCons will prefer the MinGW tools over the Cygwin tools, if they are both installed, regardless of the order of the bin directories in the PATH variable. If you have both MSVC and MinGW installed and you want to use MinGW instead of MSVC, then you must explictly tell SCons to use MinGW by passing

tools=['mingw']

to the Environment() function, because SCons will prefer the MSVC tools over the MinGW tools.

So, change the instantiation of your Environment to something like this:

env = Environment(tools=['mingw'])

If you need to specify more in the Environment constructor, you can do something like this:

env = Environment(tools=['mingw'], variables = command_line_vars)
Brady
  • 10,207
  • 2
  • 20
  • 59
  • I have installed Microsoft visual studio 2010 I mean I have MSVC tools but I do not enter it's path in my environment variable and I just need mingw. So as you sad I have to strictly tell scons to use mingw but the problem is I tried to change but in my code there is "env = Environment(variables = command_line_vars)" and if I change command_line_vars to tools=['mingw'] my code does not work.Can u suggest me a way to keep on both of them? I am not familiar with scons and python. By the way I thank very much for being patient – Mohammad Reza Rezwani Aug 01 '13 at 18:28