|
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 think that, as usually, I make a silly mistake somewhere. Any suggestions? |
Plucky
Member #1,346
May 2001
|
Have you tried manually calling: |
Tchiwawa
Member #4,546
April 2004
|
Yes, I did. It complained - no rule to make target... |
Plucky
Member #1,346
May 2001
|
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. note: in a single file, no *.o files are created... ? My makefile:
I don't like no directory in RES = edit: |
ReyBrujo
Moderator
January 2001
|
The makefiles are fine. The problem is something else. Have you saved the file before compiling? -- |
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
|
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] |
Tchiwawa
Member #4,546
April 2004
|
This is strange: 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
|
You are not compiling the hello_world.c file. -- |
Tchiwawa
Member #4,546
April 2004
|
I don't understand. I am recompiling the object file?... |
Plucky
Member #1,346
May 2001
|
g++.exe hello_world.o 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: |
|