Whenever I include this file more then once:
#ifndef GFUNC_GAURD
#define GFUNC_GAURD
#ifdef _WIN32
#pragma once
#endif
#include "DarkGDK.h"
// For getting the next unused ID
int GetNextID( )
{
int temp = 1;
while( dbObjectExist( temp ) ) // Found an id == temp?
temp++;
return temp;
}
#endif // GFUNC_GAURD
I get this error even though I've got include gaurds:
------ Build started: Project: Dark GDK - Test Game, Configuration: Debug Win32 ------
Compiling...
cbEntity.cpp
Main.cpp
Generating Code...
Linking...
cbEntity.obj : error LNK2005: "int __cdecl GetNextID(void)" (?GetNextID@@YAHXZ) already defined in Main.obj
Debug\Dark GDK - Test Game.exe : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://c:\Documents and Settings\tom\My Documents\Visual Studio 2008\Projects\Project1\Project1\Dark GDK - Test Game\Dark GDK - Test Game\Debug\BuildLog.htm"
Dark GDK - Test Game - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any help would be appreciated
#ifdef _in_programming_heaven_
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif