This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Undefined References


On Nov 30, 2007 10:28 PM, Michael Sullivan <michael@espersunited.com> wrote:
>
> On Fri, 2007-11-30 at 22:01 -0600, Tom Browder wrote:
> > On Nov 30, 2007 7:26 PM, Michael Sullivan <michael@espersunited.com> wrote:
> > > I'm having trouble building my project.  This is my first project I've
> > > worked on that uses make, so I'm having a lot of problems with it.
> > > Here's my Makefile:
> > ...
> > Without even looking in detail at the source I see that the following
> > line is a compile line and should not have anything but the source
> > being compiled:
> >
> > > battle.o: battle.cpp
> > >         reset; $(CC) $(CFLAGS) -c battle.cpp character.o $(LIBS); rm *~
> >
> > Try changing to:
> >
> > battle.o: battle.cpp
> >          reset; $(CC) $(CFLAGS) -c battle.cpp; rm *~
> >
> > and see what happens.
...
> This is make battle after applying the change you suggested,  I deleted
> *.o just to make sure the object files were cureent:
>
> In file included from battle.cpp:4:
> /usr/local/include/SDL/SDL_gfxPrimitives.h:17:17: error: SDL.h: No such
> file or directory

You may need the -I (hyphen uppercase i) option to tell gcc where to
find SDL.h.  For instance:

battle.o: battle.cpp
         reset; $(CC) $(CFLAGS) -c battle.cpp character.o
-I/path/to/SDL.h; rm *~

> character.h:8: warning: 'class Character' has virtual functions but
> non-virtual destructor

Just change line 11 of character.h to:

  virtual ~Character();

-Tom

Tom Browder
Niceville, Florida
USA


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]