6 Replies Latest reply on Mar 31, 2015 2:49 PM by user_78878863

    the command 'arm-none-eabi-gcc.exe' failed with exit code '1'

    ahmed.akl

       Hello everybody,

         

      i've a problem that i managed to solve, but i couldn't understand whey the solution worked.

         

      when i build my project i get this error 

         

      the command 'arm-none-eabi-gcc.exe' failed with exit code '1'

         

      When i checked the output window i found this build error

         

      multiple definition of `MY_FoundObserver'

         

       

         

      I have 3 files main.c, my_ble.c, and my_ble.h

         

      I used the following at the beginning of the header file to avoid any redefinitions

         

       #ifndef MY_BLE_H

         

      #define MY_BLE_H

         

      #define FALSE (0u)

         

      uint8 MY_FoundObserver = FALSE;

         

      ......

         

      #endif

         
           The solution:   
         
          after several hours and trying everything even non-logical solutions, i found that the reason was   
         
           uint8 MY_FoundObserver = FALSE;   
         
              
         
          When i write it as   
         
           uint8 MY_FoundObserver ;   
         
          everything goes fine.   
         
              
         
          Can anyone tell me the reason behind this? why the initialization made this problem?   
         
              
         
          Thanks