So I have several autogenerated files, each defines a complex struct with a unique name. They consists of some primitive types and structs.
Here is a little scheme of that two files. One car.h
and one bike.h
, each file defines the same struct called Coordinates
. But when I try to compile I get redefinition errors.
Is it possible to include that header files both? Or do I have to merge them into one header?
car.h
#ifndef CAR_H_
#define CAR_H_
#pragma pack(push,4)
typedef struct
{
uint32 pos_x;
uint32 pos_y
} Coordinates;
#pragma pack(pop)
#pragma pack(push,1)
typedef struct
{
tUInt8 id;
Coodinates position_of_car;
} Car;
#pragma pack(pop)
[...]
Bike.h defines Coordinates
as well.
bike.h
#ifndef BIKE_H_
#define BIKE_H_
#pragma pack(push,4)
typedef struct
{
uint32 pos_x;
uint32 pos_y
} Coordinates;
#pragma pack(pop)
#pragma pack(push,1)
typedef struct
{
uint8 id;
Coodinates position_of_car;
} Bike;
#pragma pack(pop)
[...]
Thank you for your suggestions in advance!