Mail Archives: djgpp/1997/12/08/21:11:43
At 03:20 12/6/1997 -0600, Robert McNulty wrote:
>I have a program that moves four to 6 balls on the screen. I want them
>to bouncs off the walls and off each other. I'm using GRX 2.2.
>How do I do this??
You may have more success posting to somewhere like
comp.graphics.algorithms, since your question is not specific to DJGPP.
Good luck, though.
Nate Eldredge
eldredge AT ap DOT net
the class definitions in one file, foo.h,
>and the member functions in another file, foo.cc. I then made sure that I
>put #include "foo.h" in my main.cc, and #include "foo.h" in my foo.cc file.
>
>Also in my foo.h file I put
>#ifndef foo_h
>#define foo_h
>//includes and code
I suspect this is your problem. Generally, you aren't supposed to put code
in a header file, except for small inline functions. I suspect what happens
is that some non-static, non-inline functions are compiled more than once in
the project, leading to a clash when they're linked.
>#endif
>Now when I compile it, it says that my class functions are declared more
>than once. What could be causing this problem? I have looked through
>source code written for Borlands compiler and I am doing nothing diffrent
>as far as the definitions go. I am using Rhide 1.4 as my editor under
>Windows 95.
I hope my suggestion above helps. Note that I don't use C++ much, so take it
with a grain of salt. If you can't figure it out, reduce the source code to
the smallest piece that demonstrates your problem and post it. Oh yeah, you
might have more luck posting to comp.lang.c++ since this is not a
DJGPP-specific issue.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -