Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:11:09+00:00 2026-06-16T00:11:09+00:00

Error 2 error C2371: ‘QixC’: redefinition; different basic types line 5 Error 5 error

  • 0
Error 2 error C2371: 'QixC': redefinition; different basic types line 5
Error 5 error C2371: 'QixC': redefinition; different basic types line 5
Error 13 error C2371: 'QixC': redefinition; different basic types line 5

This is the part of the file Game.h:

#include "Graphics_Console.h"
#include <stdio.h>
#include <conio.h>

typedef struct
{
int X;
int Y;
}QixC;
typedef struct
{
int X;
int Y;
}CCursor;

And I use them in Game.c :

#include "Game.h"
#include <stdio.h>
#include <conio.h>
#include <time.h>
int QIX(int nivell)
{
QixC Qix;
CCursor Cursor;
HANDLE hScreen;
int DirQixX,DirQixY;
int IniciX,IniciY;
int FiX, FiY;
int DirStix=0;
int Area=0,AreaTotal=0,AreaObjectiu=(FI_X-INICI_X)*(FI_Y-INICI_Y)*0.75;
int Pantalla=1;
int Puntuacio=0;
int tecla=0;
int viu=1;
int NCops=0, Velocitat=1000/(nivell*0.70);
int XocStix=0;
char continuar[1];

hScreen = GetStdHandle(STD_OUTPUT_HANDLE);
InitScreen(hScreen);
do
{
    system("CLS");
    IniciX=INICI_X,IniciY=INICI_Y;
    FiX=FI_X, FiY=FI_Y;
    Cursor.X=INICI_X+(FiX-INICI_Y)/2,Cursor.Y=FI_Y;

    DibuixarRectangle(IniciX,IniciY,FI_X,FI_Y,hScreen);
    InfoPuntsPartida(hScreen, Puntuacio);
    InfoPantallaPartida(hScreen, Pantalla);

    Qix.X=Aleatori(IniciX+1,FiX-1),Qix.Y=Aleatori(IniciY+1,FiY-1);
    InicialitzarDirQix(&DirQixX,&DirQixY);
    PintarQix(Qix,hScreen);
    PintarCursor(Cursor.X,Cursor.Y,hScreen);

    do{
        if(_kbhit())
        {   
            tecla=LlegirEvent();
            TractarEvent(tecla,Cursor,&IniciX,&IniciY,&FiX,&FiY,Qix,&DirStix,&Area,hScreen);
            if(Area)
            {
                Puntuacio=Puntuacio+Area;
                AreaTotal+=Area;
                Area=0;
                InfoPuntsPartida(hScreen,Puntuacio);
            }
        }
        NCops++;
        if(NCops==Velocitat)
        { 
            if(DirStix!=0)
                XocStix=QiXXocStiX(Qix,Cursor,DirStix);
            if(!XocStix)
                MoureQix(Qix,&DirQixX,&DirQixY,IniciX,IniciY,FiX,FiY,hScreen);
            else
                viu=0;
            NCops=0;
        }
    }while((tecla!=TECLA_q)&&(tecla!=TECLA_Q)&&viu &&(AreaTotal<AreaObjectiu));
    GameOver(hScreen);
    TextColor(LIGHTGREY,BLACK,hScreen);
    GotoXY(0,FI_Y+1,hScreen);
    return Puntuacio;
    system ("PAUSE");
    printf("Continuar?(s/n)");
    scanf("%c",&continuar);
}while(continuar!="s");
}

Sorry for the foreign words and names, english is not my first language.
I can’t see where is redefined. They don’t appear anywhere else,but are passed as parameters to some functions. Any help, please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:11:10+00:00Added an answer on June 16, 2026 at 12:11 am

    Try guarding your header against multiple inclusion.

    #ifndef GAME_H
    #define GAME_H
    
    #include "Graphics_Console.h"
    #include <stdio.h>
    #include <conio.h>
    
    typedef struct
    {
        int X;
        int Y;
    }QixC;
    
    typedef struct
    {
        int X;
        int Y;
    }CCursor;
    
    #endif /* GAME_H */
    

    By default, if you include multiple headers which directly or indirectly include your header, you’ll get multiple competing (if identical) versions of its structures and functions. You can avoid this by starting your header

    #ifndef SOMETHING_UNIQUE_TO_YOUR_HEADER
    #define SOMETHING_UNIQUE_TO_YOUR_HEADER
    

    and ending it

    #endif /* SOMETHING_UNIQUE_TO_YOUR_HEADER */
    

    which guarantees that any source file will include at most a single copy of your structures.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The full error is 1>d:\test\src\search.cpp(130): error C2371: 'Pos' : redefinition; different basic types 1>
I am getting C++ Compiler error C2371 when I include a header file that
Error occurs on this line: xPoint is Int32 randomsize is int xPoint = pictureBox1.Width
Error: A Web Part or Web Form Control on this Page cannot be displayed
Error display as Incorrect syntax near '@Cmp_DocPath', if i use comment Line code I
Error loading script occurs under FireFox 3 if I quickly click different links on
error - The multi-part identifier Grant.EmpID could not be bound. query - select emp.EmpID,
Error in line 9, 10 and 13 no operator found which takes a left-hand
error: dereferencing pointer to incomplete type The problem line is gl->point[0] = (struct list
c++ problem different basics types during converting variables Yes, stupid problem, but I'm newbie

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.