0

i am trying to make an header but it gives me error :

#ifndef __OFFSETS__H_
#define __OFFSETS__H_

typedef unsigned long MAIN = 0x22EA120;//0x022BF0C0 ;
typedef unsigned long RECOILVT = 0x020A3ACC;//0x020FA644;
typedef unsigned long DEVIATIONVT = 0x020A3AC8;//0x020FA640;

#define BF3_X                       
#define BF3_X_BASE                  
#define BF3_X_SIZE                  
#define OFFSET_CLIENTGAMECONTEXT    
#define OFFSET_BORDERINPUTNODE      
#define OFFSET_DXRENDERER           
#define OFFSET_GAMERENDERER         
#define pbcl_BASE                   
#define OFFSET_PBSS_BUFFER          
#define OFFSET_PBSS_TAKESS                 
#define OFFSET_GIVEDAMAGE           Address
#define OFFSET_COMPUTEAAB           0x010C95F0 // Function - BF3_X_BASE = IDA       
#define OFFSET_AABWORLDTRANSFORM    0x010C6610 // Function - BF3_X_BASE = IDA Address
#define OFFSET_DBGRENDERER2         0x00000000 // Function - BF3_X_BASE = IDA 
#define OFFSET_DBGRENDRAWTEXT       0x004B7610 // Function - BF3_X_BASE = IDA   
#define OFFSET_DBGRENDRAW2DLINE     0x004B9980 // Function - BF3_X_BASE = IDA 
#define OFFSET_DBGRENDRAWRECTLINE   0x004A11E0 // Function - BF3_X_BASE = IDA Address
#define OFFSET_DBGRENDRAWRECT           
#define OFFSET_DBGRENDRAWSPHERE     0x004B7610 // Function - BF3_X_BASE = IDA 
#define OFFSET_UPDATEMATRICES       0x006C3A90 // Function - BF3_X_BASE = IDA     
#define OFFSET_W2S                  0x00EF1590 // Function - BF3_X_BASE 
#define OFFSET_RS_BEGINDRAW         0x006800A1 // Function - BF3_X_BASE = IDA 
#define OFFSET_CLIENTPLAYER_ENTRY   0x00A99A20 // Function - BF3_X_BASE = IDA Address
#define OFFSET_CSW_GETWEAPON        0x01049B60 // Function - BF3_X_BASE = IDA 
#define OFFSET_CSW_GETHEAT          0x00000000 // Function - BF3_X_BASE = IDA 
#endif

the error is

error C2513: 'unsigned long' : no variable declared before '='

and i don't know why ? any idea ?

simonc
  • 41,632
  • 12
  • 85
  • 103
user2594386
  • 1
  • 1
  • 2
  • You're using a [reserved identifier](http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier). – chris Aug 11 '13 at 07:16
  • You should probably take out yor fine introductory book and read about typedefs, macros, and variables. – molbdnilo Aug 11 '13 at 07:53

2 Answers2

3

These lines are incorrect

typedef unsigned long MAIN = 0x22EA120;//0x022BF0C0 ;
typedef unsigned long RECOILVT = 0x020A3ACC;//0x020FA644;
typedef unsigned long DEVIATIONVT = 0x020A3AC8;//0x020FA640;

You are defining a type. You cannot give a type a value.

Do one or the other!

EDIT

Either

a)

typedef unsigned long MAIN;
typedef unsigned long RECOILVT;
typedef unsigned long DEVIATIONVT;

or

b)

#define MAIN 0x22EA120
#define RECOILVT 0x020A3ACC
#define DEVIATIONVT 0x020A3AC8

or

c)

const int MAIN = 0x22EA120;//0x022BF0C0 ;
const int RECOILVT = 0x020A3ACC;//0x020FA644;
const int DEVIATIONVT = 0x020A3AC8;//0x020FA640;

Your choice

Ed Heal
  • 59,252
  • 17
  • 87
  • 127
0

I think you mean typedef unsigned long MAIN = 0x22EA120; to be const unsigned long MAIN = 0x22EA120;//0x022BF0C0 ; perhaps?

Mats Petersson
  • 126,704
  • 14
  • 140
  • 227
  • Yes, we'te both guessing. When I wrote my reply, you didn't have a "solution", so I thought I'd provide something that solves the problem - because I think that's what the OP wanted to do. – Mats Petersson Aug 11 '13 at 08:14