[comp.lang.c++] A G++ Makefile

kim@unagi.cis.upenn.edu (JEE-IN KIM) (01/27/91)

Hi,

I am trying to write a C++ program of an X-window application.
The makefile for the program is at the end of this message. 
Unfortunately, it produces the following error message.
==========
> make
g++ -Wall -g -o gb -lXaw -lXmu -lXt -lX11
crt0.c:731: Undefined symbol _main referenced from text

*** Error code 1
make: Fatal error: Command failed for target `gb'
> 
==========
Could you please let me know what is wrong with my makefile?
Please E-mail me. Thanks in advance.

Jee-In
==================================================================
BIN= /usr/local/bin
INC= /usr/include/X11  /usr/local/lib/g++-include  
LIB = -lXaw -lXmu -lXt -lX11

C_FLAG= -Wall -g

SRC= test.cc
OBJ= test.o

.c.o:
	g++ $(C_FLAG) -c $<

gtest: 
	g++ $(C_FLAG) -o $@ $(LIB)

install: test
	cp test $(BIN)/gb

depend:
	makedepend $(INC) $(SRC)

clean:
	-rm *.o test *~ *bak core
---------------------------
Jee-In Kim
kim@unagi.cis.upenn.edu
---------------------------