Original Post
Ok, so I am trying to structure my code "professionaly", using #ifndef and such to make sure my headers don't repeat. Yet they do, and I get errors. It says my functions from tga.h are defined twice, but I put guards. I don't know what's going on.
//MAIN
#include <tga.h>
#include "texture.h"
//code
//tga.h
#ifndef _TGA_LOADER_
#define _TGA_LOADER_
int loadTGA(char *filename) // <--- lets just say
{
//stuff
}
#endif
//texture.h
#ifndef _TEXTURE_HANDLER_CLASS_
#define _TEXTURE_HANDLER_CLASS_
class TEXTURE
{
//stuff
};
#endif
//texture.cpp
#ifndef _TEXTURE_HANDLER_FUNC_
#define _TEXTURE_HANDLER_FUNC_
#include <tga.h>
#include "texture.cpp"
void TEXTURE::something() // <-- some function from texture.h
{
}
#endif