SimpleIDE compile errors
Two of my students are working with an ActivityBot, programming it in C with SimpleIDE. They are getting several compile errors that I can't resolve. Any help is much appreciated!
Their code for trying to test the servos is:
#include "simpletools.h"
#include "abdrive.h"
int main()
{
while(1)
{
drive_trimSet(0, 0, 0);
drive_speed(60, 60);
//pause(8000);
//drive_speed(0, 0);
}
}
The compile errors are as follows:
Project Directory: /Users/computer_science_2/Documents/SimpleIDE/
SimpleIDE Version 1.1.0
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/
/Users/computer_science_2/Documents/SimpleIDE/ Updated on: 2018-02-14
propeller-elf-gcc -v GCC 4.6.1 (propellergcc_v1_0_0-36-g4c46ecb)
propeller-elf-gcc -I . -L . -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/cmm/ -o cmm/brad.elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 brad.c -lm -lsimpletools -lsimpletext -lsimplei2c -labdrive -lm -lsimpletools -lsimpletext -lsimplei2c -lm -lsimpletools -lsimpletext -lm -lsimpletools -lm
In file included from brad.c:6:0:
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h: In function 'main':
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h:3:3: warning: implicit declaration of function 'servo_angle' [-Wimplicit-function-declaration]
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h:7:3: warning: implicit declaration of function 'servo_setramp' [-Wimplicit-function-declaration]
brad.c: At top level:
brad.c:7:5: error: redefinition of 'main'
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h:1:5: note: previous definition of 'main' was here
brad.c: In function 'main':
brad.c:15:3: warning: implicit declaration of function 'drive_trimSet' [-Wimplicit-function-declaration]
brad.c:16:3: warning: implicit declaration of function 'drive_speed' [-Wimplicit-function-declaration]
Done. Build Failed!
Their code for trying to test the servos is:
#include "simpletools.h"
#include "abdrive.h"
int main()
{
while(1)
{
drive_trimSet(0, 0, 0);
drive_speed(60, 60);
//pause(8000);
//drive_speed(0, 0);
}
}
The compile errors are as follows:
Project Directory: /Users/computer_science_2/Documents/SimpleIDE/
SimpleIDE Version 1.1.0
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/
/Users/computer_science_2/Documents/SimpleIDE/ Updated on: 2018-02-14
propeller-elf-gcc -v GCC 4.6.1 (propellergcc_v1_0_0-36-g4c46ecb)
propeller-elf-gcc -I . -L . -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -I /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive -L /Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/cmm/ -o cmm/brad.elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 brad.c -lm -lsimpletools -lsimpletext -lsimplei2c -labdrive -lm -lsimpletools -lsimpletext -lsimplei2c -lm -lsimpletools -lsimpletext -lm -lsimpletools -lm
In file included from brad.c:6:0:
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h: In function 'main':
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h:3:3: warning: implicit declaration of function 'servo_angle' [-Wimplicit-function-declaration]
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h:7:3: warning: implicit declaration of function 'servo_setramp' [-Wimplicit-function-declaration]
brad.c: At top level:
brad.c:7:5: error: redefinition of 'main'
/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h:1:5: note: previous definition of 'main' was here
brad.c: In function 'main':
brad.c:15:3: warning: implicit declaration of function 'drive_trimSet' [-Wimplicit-function-declaration]
brad.c:16:3: warning: implicit declaration of function 'drive_speed' [-Wimplicit-function-declaration]
Done. Build Failed!
Comments
Mike
BTW: The only error that causes the failure on your system is "brad.c:7:5: error: redefinition of 'main'". The other results are warnings, that are important but would not have caused a compile failure...
The error is stating that 'main' was already defined in the library file "/Users/computer_science_2/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/abdrive.h". Did someone edit that library file, by mistake? There should be no definition of 'main' in that file!
dgately
If I were to guess, someone accidentally saved a c file with main() to the library.
Tom