ducanhnguyen
ducanhnguyen

Reputation: 171

Can not run make command in Dev-cpp application

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:

make command

The console displays many errors relating to included headers.

make result

How can I run make command without any errors? Thanks in advance.

Upvotes: 1

Views: 1004

Answers (2)

ducanhnguyen
ducanhnguyen

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

right make command

Upvotes: 0

goldstar
goldstar

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

Related Questions