<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.1.8">
</HEAD>
<BODY>
Hi,<BR>
Has anyone here got good c++ programing knowledge?<BR>
<BR>
I've got a Makefile problem, on two files which both need 1 header<BR>
<BR>
There are 2 cpp files : main.cpp &amp; jgame2d.cpp<BR>
Jgame2d.cpp has a header (jgame2d.h) which contains stuff for the game library.<BR>
<BR>
The structure is:<BR>
<BR>
main.cpp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&gt; main.h<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jgame2d/jgame2d.h<BR>
<BR>
jgame/jgame2d.cpp&nbsp;&nbsp;&nbsp; &gt;&gt;&gt;&nbsp; jgame2d/jgame2d.h<BR>
<BR>
The code is all correct (it does have a few warnings...), the problem is that the compiler thinks that everything in jgame2d.h has been defined twice, by main.cpp &amp; jgame2d.cpp (as they both use that file)
<PRE>
gcc -Wall -ansi main.cpp jgame2d/jgame2d.cpp -o main -lGL -lGLU `sdl-config --cflags --libs`
In file included from main.cpp:30:
jgame2d/jgame2d.h:52:7: warning: no newline at end of file
In file included from jgame2d/jgame2d.cpp:30:
jgame2d/jgame2d.h:52:7: warning: no newline at end of file
jgame2d/jgame2d.cpp:165:2: warning: no newline at end of file
<FONT COLOR="#ff0000">/tmp/ccEE8s0W.o(.bss+0x0): multiple definition of `keyboard_state'</FONT>
/tmp/cc5N5aQs.o(.bss+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [all] Error 1</PRE>
Does anyone know how to fix this problem? I think it's a simple solution, but I don't know it....<IMG SRC="cid:1062898665.11730.9.camel@Presario" ALIGN="bottom" ALT=":(" BORDER="0"><BR>
<BR>
<BR>
-thanks<BR>
<BR>
<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
--- Jethro<BR>
<BR>
<A HREF="%20http://homepages.paradise.net.nz/jethroc/">dodocaptain@paradise.net.nz</A><BR>
<A HREF="%20http://homepages.paradise.net.nz/jethroc/">homepages.paradise.net.nz/jethroc/</A><BR>
<BR>
</TD>
</TR>
</TABLE>

</BODY>
</HTML>