Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU Newsgroups: comp.windows.x Subject: Re: Help: C++ & X programming Message-ID: <9101271131.AA10851@lightning.McRCIM.McGill.EDU> Date: 27 Jan 91 11:31:33 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 37 > 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 > Could you please let me know what is wrong with my makefile? [relevant excerpt from Makefile] > gtest: > g++ $(C_FLAG) -o $@ $(LIB) This really is not an X problem; this is a basic compiler and/or make use problem. With the command I have quoted, g++ -Wall -g -o gb -lXaw -lXmu -lXt -lX11 you are telling g++ to link your object files together to form an executable called gb. However, you aren't giving it any object files to link together! Hardly surprising it doesn't like you. I don't quite know where the gb is coming from; $@ is supposed to be the target name, which would be gtest in this case. As a first guess at what you intend to do, I would propose > gtest: $(OBJ) > g++ $(C_FLAG) -o $@ $(OBJ) $(LIB) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu