Thread: Include and #definition questions

  1. #1
    Registered User
    Join Date
    Feb 2020
    Posts
    1

    Include and #definition questions

    I am not sure what to do with this one.

    I am getting the error
    c:/vsarm/armcc/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: build/main.o:U:\xxx\xxx\xxx/Src/LCD/..\local/en.h:76: multiple definition of `xMenu'; build/menu.o:U:\xxx\xxx\xxx/Src/LCD/..\local/en.h:76: first defined here

    So the details are

    local\en.h
    Code:
    #ifndef ___english_H
    #define ___english_H
    
    #inlcude "xxxx"
    
    #define XMenu 6
    
    
    #endif //___english_H

    LCD\menu.h
    Code:
    #ifndef ___MENU_H
    #define ___MENU_H
    
    
    #include "..\local\en.h"
    #endif //___MENU_H
    LCD\menu.c
    Code:
    #include "menu.h"
    \main.c
    Code:
    #include "LCD/menu.h"
    EDIT


    Got it figured out I had an additional variable defined as well in the en.h file
    local\en.h
    Code:
    #ifndef ___english_H
    #define ___english_H
    
    #inlcude "xxxx"
    
    #define XMenu 6
    
    
    #define X_MENU_ITEMS 11
    #define X_WIDTH 10
    char xMenu[X_MENU_ITEMS][X_MENU_WIDTH] = {
        "one"
        ,"two"
        ,"three"
        ,"four"
        ,"5"
        ,"6"
        ,"7"
        ,"8"
        ,"9"
        ,"10"
        ,"11"
    };
    
    
    
    #endif //___english_H
    Last edited by user12345678912; 02-28-2020 at 01:59 PM. Reason: Question was figured out

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-10-2017, 06:27 AM
  2. Replies: 1
    Last Post: 11-06-2011, 06:20 PM
  3. Multiple definition error, one definition
    By frog in forum C++ Programming
    Replies: 9
    Last Post: 10-21-2010, 03:15 AM
  4. A simple problem with "include" definition and makefile
    By junketeer in forum C++ Programming
    Replies: 2
    Last Post: 03-31-2009, 03:01 AM

Tags for this Thread