Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » devcpp + custom mingw = mess ?

This thread is locked; no one can reply to it. rss feed Print
devcpp + custom mingw = mess ?
Tchiwawa
Member #4,546
April 2004

As we are talking about Dev-cpp and MinGW, I have quite a strange problem.

I have installed MinGW, set my paths, compiled Allegro and some libraries to d:\cpp\mingw.

Then I installed Dev-cpp to d:\cpp\devcpp and configured it to recognize mingw directory and so on.

When I try to compile a simple hello world program

#include <iostream>

using namespace std;

int main (int argc, char *argv[])
{
  cout << "Hello World!" << endl;
  cout << "Press ENTER to continue..." << endl; 
  cin.get();
  return 0;
}

I get this error:

Compiler: Default compiler
Building Makefile: "D:\cpp\devcpp\Makefile.win"
Executing  make...
mingw32-make -f "D:\cpp\devcpp\Makefile.win" all
g++.exe -c hello_world.cpp -o hello_world.o -I"D:/cpp/mingw/include"  -I"D:/cpp/mingw/include/c++/3.4.2"  -I"D:/cpp/mingw/include/c++/3.4.2/mingw32"   
g++.exe: no input files

mingw32-make: *** [hello_world.o] Error 1
Execution terminated

By manually calling g++ and ld from command line, I can compile it without any problems.

My hello_world.cpp is stored in d:\cpp\devcpp.
I guess this may be caused by messed paths or something, I wasn't able to find any help about this on the Internet.

I think that, as usually, I make a silly mistake somewhere. Any suggestions?

Plucky
Member #1,346
May 2001
avatar

Have you tried manually calling:
mingw32-make -f "D:\cpp\devcpp\Makefile.win" all
from the command line?

Tchiwawa
Member #4,546
April 2004

Yes, I did. It complained - no rule to make target...

Plucky
Member #1,346
May 2001
avatar

Are you using a project or just compiling a single file?

[edit] The "makefile.win" should still be intact when Dev-C++ created it in order to compile your project. The fact that it appears not to be the right one, implies that a wrong directory is most likely the issue. Perhaps the actual dev-c++ application being run is not where you think it is or not in the same location as the project.

Tchiwawa
Member #4,546
April 2004

Great. Thank for suggestion - I didn't think about this.

As a single file I can compile it.
As a project not.
=problem with makefile
=bug?
=bad settings?

note: in a single file, no *.o files are created... ?

My makefile:

1# Project: hello_world
2# Makefile created by Dev-C++ 4.9.9.2
3 
4CPP = g++.exe
5CC = gcc.exe
6WINDRES = windres.exe
7RES =
8OBJ = hello_world.o $(RES)
9LINKOBJ = hello_world.o $(RES)
10LIBS = -L"D:/cpp/mingw/lib"
11INCS = -I"D:/cpp/mingw/include"
12CXXINCS = -I"D:/cpp/mingw/include" -I"D:/cpp/mingw/include/c++/3.4.2" -I"D:/cpp/mingw/include/c++/3.4.2/mingw32"
13BIN = hello_world.exe
14CXXFLAGS = $(CXXINCS)
15CFLAGS = $(INCS)
16RM = rm -f
17 
18.PHONY: all all-before all-after clean clean-custom
19 
20all: all-before hello_world.exe all-after
21 
22 
23clean: clean-custom
24 ${RM} $(OBJ) $(BIN)
25 
26$(BIN): $(OBJ)
27 $(CPP) $(LINKOBJ) -o "hello_world.exe" $(LIBS)
28 
29hello_world.o: hello_world.cpp
30 $(CPP) -c hello_world.cpp -o hello_world.o $(CXXFLAGS)

I don't like no directory in RES =

edit:
I directly run dev-cpp.exe from its directory.

ReyBrujo
Moderator
January 2001
avatar

The makefiles are fine. The problem is something else. Have you saved the file before compiling?

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Tchiwawa
Member #4,546
April 2004

Yes, I won't be able to compile it manually if it hadn't existed :)

Plucky
Member #1,346
May 2001
avatar

a .o file would be created even if the project only has one source file. When not in a project, a .o file may be automatically deleted.

The problem is most likely a wrong directory, perhaps as a setting in Dev-Cpp (compiler options->directories), or perhaps you're running the wrong Dev-Cpp application.

[edit]
I thought you had problems directly using make from the command line with this makefile?

Tchiwawa
Member #4,546
April 2004

This is strange:
By using devcpp I get:

Compiler: Default compiler
Building Makefile: "D:\cpp\devcpp\Makefile.win"
Executing  make...
mingw32-make -f "D:\cpp\devcpp\Makefile.win" all
g++.exe hello_world.o hello_world_private.res -o "hello_world.exe" -L"D:/cpp/mingw/lib"  
g++.exe: no input files

mingw32-make: *** [hello_world.exe] Error 1
Execution terminated

With Windows command line (cmd):

mingw32-make
g++.exe hello_world.o hello_world_private.res -o "hello_world.exe" -L"D:/cpp/mingw/lib"  
g++.exe: no input files

mingw32-make: *** [hello_world.exe] Error 1
Execution terminated

Using MSYS:

$ mingw32-make
g++.exe hello_world.o hello_world_private.res -o "hello_world.exe" -L"D:/cpp/mingw/lib"

note: with MSYS, something weird happens so I have "no access rights" to my file, but at least it is compiled.

I think that mingw needs a path to the project / it needs to be set in the makefile. ?

ReyBrujo
Moderator
January 2001
avatar

You are not compiling the hello_world.c file.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Tchiwawa
Member #4,546
April 2004

I don't understand. I am recompiling the object file?...

Plucky
Member #1,346
May 2001
avatar

g++.exe hello_world.o
vs.
g++.exe hello_world.cpp

One does not "compile" an object file.

Tchiwawa
Member #4,546
April 2004

OK, but this still does not solve the problem with devcpp.

edit:
The solution seems to be to have devcpp in different directory and then copy all libs created by "custom" mingw to devcpp.

Go to: