Robot-Will / Stino

A Sublime Text Plugin for Arduino
Other
1.58k stars 250 forks source link

Sketch does not build using Stino... #416

Closed KurtE closed 7 years ago

KurtE commented 7 years ago

I have a test app that currently has two .ino files (not sure if that is the issue), It compiles fine on Arduino 1.8.2 with latest Teensyduino 1.36 for Teensy 3.2.

https://github.com/KurtE/AX12_Test

Gives lots of duplicate defined errors:


[Build] C:/Users/kurte/Documents/Arduino/Github/AX12_Test...
[Step 1] Check Toolchain.
[Step 2] Find all source files.
[Step 3] Start building.
[1.8%] Compiling AX12_Test.ino.cpp...
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:85:30: error: redefinition of 'const byte pgm_axdIDs []'
 static const byte pgm_axdIDs[] PROGMEM = {
                              ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:85:19: note: 'const byte pgm_axdIDs [18]' previously defined here
 static const byte pgm_axdIDs[] PROGMEM = {
                   ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:102:25: error: redefinition of 'const char* IKPinsNames []'
 const char* IKPinsNames[] = {
                         ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:102:13: note: 'const char* IKPinsNames [18]' previously defined here
 const char* IKPinsNames[] = {
             ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:123:21: error: redefinition of 'BioloidControllerEx bioloid'
 BioloidControllerEx bioloid = BioloidControllerEx(); 
                     ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:123:21: note: 'BioloidControllerEx bioloid' previously declared here
 BioloidControllerEx bioloid = BioloidControllerEx(); 
                     ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:127:16: error: redefinition of 'word g_wVoltage'
 word           g_wVoltage;
                ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:127:16: note: 'word g_wVoltage' previously declared here
 word           g_wVoltage;
                ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:128:31: error: redefinition of 'char g_aszCmdLine [80]'
 char           g_aszCmdLine[80];
                               ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:128:16: note: 'char g_aszCmdLine [80]' previously declared here
 char           g_aszCmdLine[80];
                ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:129:16: error: redefinition of 'uint8_t g_iszCmdLine'
 uint8_t        g_iszCmdLine;
                ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:129:16: note: 'uint8_t g_iszCmdLine' previously declared here
 uint8_t        g_iszCmdLine;
                ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:130:16: error: redefinition of 'boolean g_fTrackServos'
 boolean        g_fTrackServos = false;
                ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:130:16: note: 'boolean g_fTrackServos' previously defined here
 boolean        g_fTrackServos = false;
                ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:133:15: error: redefinition of 'byte g_bServoID'
 byte          g_bServoID;
               ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:133:15: note: 'byte g_bServoID' previously declared here
 byte          g_bServoID;
               ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:134:15: error: redefinition of 'word g_wServoGoalPos'
 word          g_wServoGoalPos;
               ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:134:15: note: 'word g_wServoGoalPos' previously declared here
 word          g_wServoGoalPos;
               ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:135:15: error: redefinition of 'word g_wServoGoalSpeed'
 word          g_wServoGoalSpeed;
               ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:135:15: note: 'word g_wServoGoalSpeed' previously declared here
 word          g_wServoGoalSpeed;
               ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void setup()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:144:6: error: redefinition of 'void setup()'
 void setup() {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:144:6: note: 'void setup()' previously defined here
 void setup() {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void loop()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:189:6: error: redefinition of 'void loop()'
 void loop() {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:189:6: note: 'void loop()' previously defined here
 void loop() {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'uint8_t GetCommandLine()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:282:9: error: redefinition of 'uint8_t GetCommandLine()'
 uint8_t GetCommandLine(void) {
         ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:282:9: note: 'uint8_t GetCommandLine()' previously defined here
 uint8_t GetCommandLine(void) {
         ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'boolean FGetNextCmdNum(word*)':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:303:9: error: redefinition of 'boolean FGetNextCmdNum(word*)'
 boolean FGetNextCmdNum(word *pw ) {
         ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:303:9: note: 'boolean FGetNextCmdNum(word*)' previously defined here
 boolean FGetNextCmdNum(word *pw ) {
         ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void AllServosOff()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:319:6: error: redefinition of 'void AllServosOff()'
 void AllServosOff(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:319:6: note: 'void AllServosOff()' previously defined here
 void AllServosOff(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void AllServosCenter()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:326:6: error: redefinition of 'void AllServosCenter()'
 void AllServosCenter(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:326:6: note: 'void AllServosCenter()' previously defined here
 void AllServosCenter(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void HoldOrFreeServos(byte)':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:336:6: error: redefinition of 'void HoldOrFreeServos(byte)'
 void HoldOrFreeServos(byte fHold) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:336:6: note: 'void HoldOrFreeServos(byte)' previously defined here
 void HoldOrFreeServos(byte fHold) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void SetServoPosition()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:355:6: error: redefinition of 'void SetServoPosition()'
 void SetServoPosition(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:355:6: note: 'void SetServoPosition()' previously defined here
 void SetServoPosition(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void SetServoReturnDelayTime()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:387:6: error: redefinition of 'void SetServoReturnDelayTime()'
 void SetServoReturnDelayTime(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:387:6: note: 'void SetServoReturnDelayTime()' previously defined here
 void SetServoReturnDelayTime(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void SetServoID()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:410:6: error: redefinition of 'void SetServoID()'
 void SetServoID(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:410:6: note: 'void SetServoID()' previously defined here
 void SetServoID(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void WaitForMoveToComplete(word)':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:431:6: error: redefinition of 'void WaitForMoveToComplete(word)'
 void WaitForMoveToComplete(word wID) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:431:6: note: 'void WaitForMoveToComplete(word)' previously defined here
 void WaitForMoveToComplete(word wID) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void GetServoPositions()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:440:6: error: redefinition of 'void GetServoPositions()'
 void GetServoPositions(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:440:6: note: 'void GetServoPositions()' previously defined here
 void GetServoPositions(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void FindServos()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:469:6: error: redefinition of 'void FindServos()'
 void FindServos(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:469:6: note: 'void FindServos()' previously defined here
 void FindServos(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: At global scope:
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:486:33: error: redefinition of 'int g_asPositionsPrev [18]'
 int g_asPositionsPrev[NUM_SERVOS];
                                 ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:486:5: note: 'int g_asPositionsPrev [18]' previously declared here
 int g_asPositionsPrev[NUM_SERVOS];
     ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:487:24: error: redefinition of 'int g_asMins [18]'
 int g_asMins[NUM_SERVOS];
                        ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:487:5: note: 'int g_asMins [18]' previously declared here
 int g_asMins[NUM_SERVOS];
     ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:488:24: error: redefinition of 'int g_asMaxs [18]'
 int g_asMaxs[NUM_SERVOS];
                        ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:488:5: note: 'int g_asMaxs [18]' previously declared here
 int g_asMaxs[NUM_SERVOS];
     ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void TrackServos(boolean)':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:490:6: error: redefinition of 'void TrackServos(boolean)'
 void TrackServos(boolean fInit) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:490:6: note: 'void TrackServos(boolean)' previously defined here
 void TrackServos(boolean fInit) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void TrackPrintMinsMaxs()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:528:6: error: redefinition of 'void TrackPrintMinsMaxs()'
 void TrackPrintMinsMaxs(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:528:6: note: 'void TrackPrintMinsMaxs()' previously defined here
 void TrackPrintMinsMaxs(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'void PrintServoValues()':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:546:6: error: redefinition of 'void PrintServoValues()'
 void PrintServoValues(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:546:6: note: 'void PrintServoValues()' previously defined here
 void PrintServoValues(void) {
      ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino: In function 'boolean GetMultax12Registers(int, int, int, uint8_t*)':
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:578:9: error: redefinition of 'boolean GetMultax12Registers(int, int, int, uint8_t*)'
 boolean GetMultax12Registers(int id, int regstart, int length, uint8_t *pab){  
         ^
C:/Users/kurte/Documents/Arduino/Github/AX12_Test/AX12_Test.ino:578:9: note: 'boolean GetMultax12Registers(int, int, int, uint8_t*)' previously defined here
 boolean GetMultax12Registers(int id, int regstart, int length, uint8_t *pab){  
         ^
[Build] Error occurred.

Almost like maybe it included the stuff twice?

I do have a few changes local to my machine, to this sketch, but they should not matter. Only real difference is on a couple of pins being defined. Could upload changes if needed

Robot-Will commented 7 years ago

It's due to a typo error, and I fixed. Still I can not pass the build. I will continue to find re reason. Thanks.

Robot-Will commented 7 years ago

I fixed. Macro caused the build problems. Thanks.