Compilation 从DOS命令提示符运行MAKE实用程序时出现问题

Compilation 从DOS命令提示符运行MAKE实用程序时出现问题,compilation,makefile,utility,Compilation,Makefile,Utility,我有: fileMainProgram.cpp fileClassImplementation.cpp fileClass.h 生成文件 在目录中。 运行cmd并键入 在修改了一段时间后收到此消息,更改文件名/扩展名,尝试不使用-f,使用gcc代替g++,等等 C:\miscprograms\Dropbox\box\Dropbox\C++\etextbook\e12\progec12\PE1C12RomanNumeric>g++-make-f makefile c:/mingw/bin/./li

我有: fileMainProgram.cpp fileClassImplementation.cpp fileClass.h 生成文件

在目录中。 运行cmd并键入

在修改了一段时间后收到此消息,更改文件名/扩展名,尝试不使用-f,使用gcc代替g++,等等

C:\miscprograms\Dropbox\box\Dropbox\C++\etextbook\e12\progec12\PE1C12RomanNumeric>g++-make-f makefile

c:/mingw/bin/./lib/gcc/mingw32/4.6.2/../../../../../../../mingw32/bin/ld.exe:makefile.tx t:文件格式不可识别;作为链接器脚本处理 c:/mingw/bin/./lib/gcc/mingw32/4.6.2/../../../../../../../mingw32/bin/ld.exe:makefile.tx t:1:语法错误 collect2:ld返回了1个退出状态

这是makefile,尝试删除目标和操作之间的行,尝试使用自动变量等

我试着把程序编译成

获取一个可执行文件,它工作正常

在我的三星手机的C4droid上运行了整个过程,一切正常。
在我的Windows7笔记本电脑上不工作。

您似乎有一个GNU Makefile,适合运行。Windows没有GNU Make,所以您需要自己下载它


您似乎已经下载了MingW,请尝试运行mingw32 make命令来执行您的makefile。

我忘了我已将包含mingw32 make的MingW的bin文件夹添加到PATH系统变量中。非常感谢您的回复。
              g++ -make -f makefile
                                      g++ -c fileClassImplementation.cpp

                           then

                                      g++ fileClassImplementation.o fileMain.cpp
 all: a

 a: romanNumeralMain.o romanNumeralImp.o
 [1 tab]g++ romanNumeralMain.o romanNumeralImp.o -o a

 romanNumeralMain.o: romanNumeralMain.cpp 
        g++ -c romanNumeralMain.cpp

 romanNumeralImp.o: romanNumeralImp.cpp
        g++ -c romanNumeralImp.cpp

 clean:
        rm romanNumeralImp.o romanNumeralMain.o a