重新定义不同的基本类型=>类型定义 [英] Redefinition different basic types => typedef

查看:199
本文介绍了重新定义不同的基本类型=>类型定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在意识到与我的问题相同的人之后,我仍然会收到此错误:

After to have been aware of the persons who had the same problem than mine, I still get this error :

错误C2371:"ST_ELLIPSE":重新定义;不同的基本类型
请参阅"ST_ELLIPSE"的声明
C2371:'ST_VECTEURS':重新定义不同的基本类型
请参阅"ST_VECTEURS"的声明
'ST_ROI':重新定义;不同的基本类型
请参阅"ST_ROI"的声明
'ST_CONVERSION':重新定义;不同的基本类型
请参阅"ST_CONVERSION"的声明
'ST_PARA_VISU':重新定义;不同的基本类型
请参阅"ST_PARA_VISU"的声明

error C2371: 'ST_ELLIPSE' : redefinition; different basic types
see declaration of 'ST_ELLIPSE'
C2371: 'ST_VECTEURS' : redefinition; different basic types
see declaration of 'ST_VECTEURS'
'ST_ROI' : redefinition; different basic types
see declaration of 'ST_ROI'
'ST_CONVERSION' : redefinition; different basic types
see declaration of 'ST_CONVERSION'
'ST_PARA_VISU' : redefinition; different basic types
see declaration of 'ST_PARA_VISU'

这是文件:

#define MAX_VAL_VISU        245
#define MAX_VAL_VISU_SUPP   128
#define MAX_VAL_OVR_SUPP    116

#define VISU_SIZE_X         672
#define VISU_SIZE_Y         512
#define DELTA_ZONE          5

#define FLAG_RIEN           1
#define FLAG_ZOOM           2
#define FLAG_DEP            4
#define FLAG_STAT           8
#define FLAG_CONTRASTE      16
#define FLAG_ZONE           32
#define FLAG_OVR_WRITE      64
#define FLAG_OVR_EFF        128
#define FLAG_OVR_TEXTE      256
#define FLAG_ROI            512  // V2.0

// flag de suppression (& avec flag au dessus)
#define FLAG2_RIEN          0  // 0 aucune autres fenetres
#define FLAG2_ZOOM          0
#define FLAG2_DEP           0
#define FLAG2_STAT          FLAG_CONTRASTE
#define FLAG2_CONTRASTE     (FLAG_STAT | FLAG_ZONE | FLAG_ROI)
#define FLAG2_ZONE          FLAG_CONTRASTE
#define FLAG2_OVR_WRITE     (FLAG_ROI | FLAG_CONTRASTE)
#define FLAG2_OVR_EFF       (FLAG_ROI | FLAG_CONTRASTE)
#define FLAG2_OVR_TEXTE     0
#define FLAG2_ROI           FLAG_CONTRASTE 


#define TYPE_MODIF_ZONE_RIEN    0 // pas de modification
#define TYPE_MODIF_ZONE_H       1 // definition de la ligne Haut
#define TYPE_MODIF_ZONE_B       2 // definition de la ligne BAS
#define TYPE_MODIF_ZONE_G       3 // definition de la ligne gauche
#define TYPE_MODIF_ZONE_D       4 // definition de la ligne droite
#define TYPE_MODIF_ZONE_P1      5 // definition du point haut/gauche
#define TYPE_MODIF_ZONE_P2      6 // definition du point bas/droite
#define TYPE_MODIF_ZONE_P3      7 // definition du point bas/gauche
#define TYPE_MODIF_ZONE_P4      8 // definition du point haut/droite

#define LUT_GRAY        0
#define LUT_COLOR1      1
#define LUT_COLOR2      2
#define LUT_FICHIER     3
#define LUT_SUPERPOSITION   4

#define NB_COULEUR 10

#define ROI_ZONE    0
#define NB_ROI      10

#define NB_UNITE    2

// structure
//***********
// V2.0
// ROI
typedef struct 
{
    // données de depart
    double x1[NB_UNITE],y1[NB_UNITE],x2[NB_UNITE],y2[NB_UNITE],d2[NB_UNITE];
    // donnee calculées
    double d1[NB_UNITE];
    double x11,y11,x22,y22; 
    // angle de rotation 
    double angle;
    // origine
    double ox,oy;
    // position foyer
    double fx1,fx2,fy1,fy2,dist;
    // min max en X et en Y
    int x_min,y_min,x_max,y_max;
}ST_ELLIPSE;
typedef struct 
{
    int nb;
    double x[NB_UNITE][10],y[NB_UNITE][10];
}ST_VECTEURS;

#define ROI_RECTANGLE   0
#define CHAR_ROI_RECTANGLE  "R"
#define ROI_ELLIPSE     1
#define CHAR_ROI_ELLIPSE    "E"
#define ROI_VECTEURS    2
#define CHAR_ROI_VECTEURS   "V"

typedef struct{
    bool flag_def_zone;
    int type_roi;
    // rectangle
    double x_zone[NB_UNITE],y_zone[NB_UNITE],dx_zone[NB_UNITE],dy_zone[NB_UNITE];
    // ellipse
    ST_ELLIPSE ellipse;
    // vecteurs
    ST_VECTEURS vecteurs;
}ST_ROI;

// V2.0
#define CONVERSION_ZONE  1  // indice dans ST_CONVERSION
// parametres de conversion pixel ->mm
typedef struct {
    double x_pix,x_mm,y_pix,y_mm;
    double coef_x;
    double coef_y;
    CString unite[2];
}ST_CONVERSION;

// V2.0
// parametres de la visu
typedef struct{
    int x_zoom,y_zoom,m_zoom; // zoom
    ST_ROI roi[NB_ROI]; // roi
    int ind_conversion;
    ST_CONVERSION coef_conversion[2]; // conversion pour stat pix->autre unité
}ST_PARA_VISU;`

有人会有什么想法吗?

Someone would have any ideas ?

非常感谢您的帮助!

推荐答案

如果您不介意使用宏,则可以在每个.h文件的顶部放置#pragma once,否则,可以使用'proper '的方法是

Putting #pragma once at the top of each .h file is the way to do it if you don't mind using macros, and otherwise, the 'proper' way to do it is

#ifndef AWESOME_H
#define AWESOME_H
class Awesome
{
    //awesome.h contents
};
#endif

这篇关于重新定义不同的基本类型=>类型定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆