Skip to main content
GameDev.net gamedev.net
🔒 Locked

g++.exe: no input files

Started by stefu May 16, 2003 at 11:58 AM 4 replies 3.8k views
Original Post
stefu
stefu
Yeah, really annoying when using makefiles in MSDOS prompt. g++ -g -c -o main.o main.cpp g++.exe: no input files MAKE: *** [main.o] Error 1 it works if I write g++ -g -c -o main.o main.cpp but not with makefile. This is stupid because I cannot use VIDE or DevCpp, only with MSYS sh shell makefiles work. Win98. Thanks for help.
cgoat
cgoat
It sounds like a DOS-UNIX format problem. Make sure to save the file in Unix mode (LF only). There''s probably a trailing CR character after the .cpp so it''s trying to open the file "main.cpp\r" which isn''t a valid file.
stefu
stefu
Didn''t help. I changed VIDE to use LF only (and checked in binary editor and there was only 0x0A at the end of each line).

Damnit, I just need tool to use gdb (not at command line).
Dave Hunt
Dave Hunt
What does your makefile look like?
stefu
stefu
quote:
Original post by Dave Hunt
What does your makefile look like?



It should be ok. It is generated with VIDE (same problem with DevCpp and my custom made makefile).

But here it is:

  
#=======================================================================
#@V@:Note: File automatically generated by VIDE - 2.00/10Apr03! (g++).
# Generated 20:40:44 16 May 2003
# This file regenerated each time you run VIDE, so save under a
# new name if you hand edit, or it will be overwritten.
#=======================================================================

# Standard defines:
CC = g++
LD = g++
WRES = windres
CCOMP = gcc
HOMEV =
VPATH = $(HOMEV)/include
oDir = .
Bin = .
libDirs =
incDirs =
LD_FLAGS =
LIBS =
C_FLAGS = -g

SRCS =\
main.cpp

EXOBJS =\
$(oDir)/main.o

ALLOBJS = $(EXOBJS)
ALLBIN = $(Bin)/protest.exe
ALLTGT = $(Bin)/protest.exe

# User defines:

#@# Targets follow ---------------------------------

all: $(ALLTGT)

objs: $(ALLOBJS)

cleanobjs:
rm -f $(ALLOBJS)

cleanbin:
rm -f $(ALLBIN)

clean: cleanobjs cleanbin

cleanall: cleanobjs cleanbin

#@# User Targets follow ---------------------------------


#@# Dependency rules follow -----------------------------

$(Bin)/protest.exe: $(EXOBJS)
$(LD) -o $(Bin)/protest.exe $(EXOBJS) $(incDirs) $(libDirs) $(LD_FLAGS) $(LIBS)

$(oDir)/main.o: main.cpp
$(CC) $(C_FLAGS) $(incDirs) -c -o $@ $<


This is weird. I found many similar problems with Google, but no-one has a solution. And it is more weird that I remember that long time ago I used DevCpp and it was ok.
Dave Hunt
Dave Hunt
Very strange.

I typically use Cygwin for console development, so I haven''t had any problems with make.

Do you have to use the MSDOS prompt, or could you get a copy of bash from the DJGPP package?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.