Reputation: 171
I have a very simple example named HelloWorld and located in folder "C:/HelloWorld" in Dev-Cpp as follows:
#include <iostream>
using namespace std;
int main(){
cout << "Hello World";
return 0;
}
Of course, if I press F11 (Compile and run) then the program executes normally. But I want to execute this program in an another way: use make command!!!
I have known that the syntax to run make command : make -f [make file name]. In Dev-Cpp, this command is make -f "Makefile.win". So I jump into HelloWorld folder and type as follows:
The console displays many errors relating to included headers.
How can I run make command without any errors? Thanks in advance.
Upvotes: 1
Views: 1004
Reputation: 171
All right. There are something wrong with my make command.
The problem is I had installed two versions of gcc in my computer. The HelloWorld example is compiled and built with the latest GCC version.
However, the make command I had type is belonged to the older GCC version. As a result, it leads to many errors.
In order to run make command correctly, I must to use the right make command that is defined in Dev-Cpp (below picture): mingw32-make.exe
Upvotes: 0
Reputation: 337
not so easy with make :) at first if you use msvc or DevCpp try to find "Export makefile" at second you need to configure your compilator(s). at third you need to show what Makefile.win contains.
man: http://www.gnu.org/software/make/manual/make.html gcc: https://gcc.gnu.org/install/binaries.html
Upvotes: 1