【问题标题】:Can't execute makefile in Windows 7无法在 Windows 7 中执行 makefile
【发布时间】:2015-08-27 08:27:02
【问题描述】:

我正在尝试编译库https://github.com/PetterS/SuiteSparse/tree/master/CSparse 在 Windows 7 上使用 MinGW。

Makefile 内容:

C:
    ( cd Lib ; $(MAKE) )
    ( cd Demo ; $(MAKE) )

all: C cov

library:
    ( cd Lib ; $(MAKE) )

cov:
    ( cd Tcov ; $(MAKE) )

clean:
    ( cd Lib ; $(MAKE) clean )
    ( cd Demo ; $(MAKE) clean )
    ( cd Tcov ; $(MAKE) clean )
    ( cd MATLAB/CSparse ; $(RM) *.o )
    ( cd MATLAB/Test    ; $(RM) *.o )

purge:
    ( cd Lib ; $(MAKE) purge )
    ( cd Demo ; $(MAKE) purge )
    ( cd Tcov ; $(MAKE) purge )
    ( cd MATLAB/CSparse ; $(RM) *.o *.mex* )
    ( cd MATLAB/Test    ; $(RM) *.o *.mex* )

distclean: purge

# do not install CSparse; use CXSparse instead
install:

# uninstall CSparse: do nothing
uninstall:

我正在输入 cmd.exe:

PS C:\Users\s\Desktop\CSparse> mingw32-make
( cd Lib ; C:/MinGW/bin/mingw32-make )
process_begin: CreateProcess(NULL, ( cd Lib ; C:/MinGW/bin/mingw32-make ), ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:8: recipe for target 'C' failed
mingw32-make: *** [C] Error 2

我的路径变量:

C:\Program Files\PC Connectivity Solution\;C:\watcom-1.3\binnt;C:\watcom-1.3\binw;C:\Program Files\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\python27\;C:\Python27\Scripts;C:\Program Files\MiKTeX 2.9\miktex\bin\;C:\Program Files\Panda3D-1.8.1\python;C:\Program Files\Panda3D-1.8.1\bin;C:\Program Files\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Skype\Phone\;C:\Program Files\MATLAB\R2014a\runtime\win32;C:\Program Files\MATLAB\R2014a\bin;C:\MinGW\bin;

我已经重新启动了 Windows。 我也尝试在cmd.exe中设置path=C:\MinGW\bin,但没有任何改变。

谁能告诉我我做错了什么?

【问题讨论】:

  • C:\mingw32\binC:\MinGW\bin?
  • 对不起。是的,它是“C:\MinGW\bin”。
  • 所以您没有逐字复制/粘贴这些详细信息。我想知道你还有什么问题。

标签: c++ makefile gnu-make mingw32 suitesparse


【解决方案1】:

我也尝试在cmd.exe中设置path=C:\mingw32\bin,但没有任何改变。

就我而言,通过键入这个,您可以使 PATH 变量包含 only 路径“C:\mingw32\bin”。 看看这个答案:https://stackoverflow.com/a/9546345/4776786

在 CMD 中试试这个:

set PATH=%PATH%;C:\mingw32\bin

通过执行该命令,您可以将该目录添加到您当前的 PATH 变量中。

但是,另一方面,为什么你不使用“我的电脑”>“属性”>“高级”>“环境变量”>“路径”?这样做,系统重启不会中断你的 PATH。

【讨论】:

  • 我已经通过“我的电脑”>“属性”>“高级”>“环境变量”>“路径”更改了 PATH 并重新启动了 Windows。但我仍然有同样的问题。
  • 很抱歉,您浪费了所有时间,但您不需要重新启动 Windows。
猜你喜欢
  • 1970-01-01
  • 2012-01-23
  • 2012-04-28
  • 1970-01-01
  • 1970-01-01
  • 2011-12-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-14
相关资源
最近更新 更多