g++.exe: fatal error: no input files

CodeLite installation/troubleshooting forum
pmjobin
CodeLite Enthusiast
Posts: 15
Joined: Thu Mar 25, 2010 7:28 pm
Genuine User: Yes
IDE Question: C++
Contact:

g++.exe: fatal error: no input files

Post by pmjobin »

Hi,

I've just installed CodeLite 7.0 Beta on a Windows 7 x64 machine and I attempted to create a simple test project using the project wizard. The main.cpp files successfully compiles to main.c.o but afterward, the link step fails with the following error:

Code: Select all

C:\Windows\system32\cmd.exe /c "D:/MinGW/bin/make.exe -j4 SHELL=cmd.exe  -e -f  Makefile"
"----------Building project:[ Test - Debug ]----------"
make.exe[1]: Entering directory 'C:/Users/pmjobin/Workspace/Test'
D:/MinGW/bin/g++.exe  -o ./Debug/Test @"Test.txt" -L.
g++.exe: error: @Test.txt -L.: No such file or directory
g++.exe: fatal error: no input files
compilation terminated.
make.exe[1]: *** [Debug/Test] Error 1
Test.mk:79: recipe for target 'Debug/Test' failed
make.exe[1]: Leaving directory 'C:/Users/pmjobin/Workspace/Test'
make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
1 errors, 0 warnings
Strangely enough, if I manually run the line "D:/MinGW/bin/g++.exe -o ./Debug/Test @"Test.txt" -L." in a console window, it works just as expected.

Thanks,
PM
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: g++.exe: fatal error: no input files

Post by eranif »

Can you please and run the exact command as codelite from a terminal ?, i.e.:

Code: Select all

C:\Windows\system32\cmd.exe /c "D:/MinGW/bin/make.exe -j4 SHELL=cmd.exe  -e -f  Makefile"
Thanks,
Eran
Make sure you have read the HOW TO POST thread
pmjobin
CodeLite Enthusiast
Posts: 15
Joined: Thu Mar 25, 2010 7:28 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: g++.exe: fatal error: no input files

Post by pmjobin »

Hi,

Here is the output of building a project freshly created with the "Simple executable (g++)" wizard by using the build command you specified in a command line prompt:

Code: Select all

C:\Users\pmjobin\Workspace\Test>C:\Windows\system32\cmd.exe /c "D:/MinGW/bin/mak
e.exe -j4 SHELL=cmd.exe  -e -f  Makefile"
"----------Building project:[ Test - Debug ]----------"
make.exe[1]: Entering directory 'C:/Users/pmjobin/Workspace/Test'
D:/MinGW/bin/g++.exe   -c  "C:/Users/pmjobin/Workspace/Test/main.cpp" -g -O0 -Wa
ll  -o ./Debug/main.cpp.o -I. -I.
/bin/sh: makedir: command not found
Test.mk:85: recipe for target 'Debug/.d' failed
make.exe[1]: *** [Debug/.d] Error 127
make.exe[1]: *** Waiting for unfinished jobs....
g++.exe: error: C:/Users/pmjobin/Workspace/Test/main.cpp -g: No such file or dir
ectory
g++.exe: fatal error: no input files
compilation terminated.
Test.mk:94: recipe for target 'Debug/main.cpp.o' failed
make.exe[1]: *** [Debug/main.cpp.o] Error 1
make.exe[1]: Leaving directory 'C:/Users/pmjobin/Workspace/Test'
Makefile:4: recipe for target 'All' failed
make.exe: *** [All] Error 2
I then added the makedir.exe program provided with CodeLite to the path and ran the build command again:

Code: Select all

C:\Users\pmjobin\Workspace\Test>C:\Windows\system32\cmd.exe /c "D:/MinGW/bin/mak
e.exe -j4 SHELL=cmd.exe  -e -f  Makefile"
"----------Building project:[ Test - Debug ]----------"
make.exe[1]: Entering directory 'C:/Users/pmjobin/Workspace/Test'
D:/MinGW/bin/g++.exe   -c  "C:/Users/pmjobin/Workspace/Test/main.cpp" -g -O0 -Wa
ll  -o ./Debug/main.cpp.o -I. -I.
g++.exe: error: C:/Users/pmjobin/Workspace/Test/main.cpp -g: No such file or dir
ectory
g++.exe: fatal error: no input files
compilation terminated.
Test.mk:94: recipe for target 'Debug/main.cpp.o' failed
make.exe[1]: *** [Debug/main.cpp.o] Error 1
make.exe[1]: *** Waiting for unfinished jobs....
make.exe[1]: Leaving directory 'C:/Users/pmjobin/Workspace/Test'
Makefile:4: recipe for target 'All' failed
make.exe: *** [All] Error 2
I noticed that compiling the Test.cpp file manually by using the context menu in the workspace view works. If I attempt to launch the build command again from this point, here is what I get:

Code: Select all

C:\Users\pmjobin\Workspace\Test>C:\Windows\system32\cmd.exe /c "D:/MinGW/bin/mak
e.exe -j4 SHELL=cmd.exe  -e -f  Makefile"
"----------Building project:[ Test - Debug ]----------"
make.exe[1]: Entering directory 'C:/Users/pmjobin/Workspace/Test'
D:/MinGW/bin/g++.exe  -o ./Debug/Test @"Test.txt" -L.
g++.exe: error: @Test.txt -L.: No such file or directory
g++.exe: fatal error: no input files
compilation terminated.
Test.mk:79: recipe for target 'Debug/Test' failed
make.exe[1]: *** [Debug/Test] Error 1
make.exe[1]: Leaving directory 'C:/Users/pmjobin/Workspace/Test'
Makefile:4: recipe for target 'All' failed
make.exe: *** [All] Error 2
Hope this helps!

Thanks,
PM
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: g++.exe: fatal error: no input files

Post by eranif »

2 things that seems strange to me here:
- codelite is running 'make.exe' and not 'mingw32-make', is it a self installed MinGW?
- Even though that codelite passed 'SHELL=CMD.EXE' in the build line, your make still searches for /bin/sh - this again seems to me that you are using the wrong make tool

Try replacing the make.exe with mingw32-make.exe

Eran
Make sure you have read the HOW TO POST thread
pmjobin
CodeLite Enthusiast
Posts: 15
Joined: Thu Mar 25, 2010 7:28 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: g++.exe: fatal error: no input files

Post by pmjobin »

I use a self-installed MinGW indeed. The make.exe is simply an exact copy of the mingw32-make.exe I made to please some autoconf scripts that were looking for make. I deleted it and cleared CodeLite's config in my user profile and now, CodeLite uses mingw32-make as expected. As for sh.exe (bash) in my path, renaming it to sh.exe.bak seems to have corrected the issue as I can now build the project successfully. I do need sh.exe in my system path, however. Is there a way to circumvent this issue in CodeLite? I am asking because a previous version of CodeLite (5.3) used to work with this setup.

Thanks,
PM
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: g++.exe: fatal error: no input files

Post by eranif »

pmjobin wrote:As for sh.exe (bash) in my path, renaming it to sh.exe.bak seems to have corrected the issue as I can now build the project successfully. I do need sh.exe in my system path, however. Is there a way to circumvent this issue in CodeLite? I am asking because a previous version of CodeLite (5.3) used to work with this setup.
Your make should have honoured the SHELL=CMD.EXE that codelite passes, if it does not, then you should upgrade your make.exe or use the one that comes with codelite

Eran
Make sure you have read the HOW TO POST thread
pmjobin
CodeLite Enthusiast
Posts: 15
Joined: Thu Mar 25, 2010 7:28 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: g++.exe: fatal error: no input files

Post by pmjobin »

Using the make bundled with CodeLite, I can have sh.exe in my path and have no problem anymore.

Thank you!
PM
Post Reply