error with new IDE download
gregfox
Posts: 68
Hi all, Just downloaded a new IDE and when running even a simple hello (in c) I get "36:1: error: expected declaration or statement at end of input"
"
What could be wrong?
Thanks!
"
What could be wrong?
Thanks!
Comments
You know, a simple hello program, or any other code gives the same error. This is not a code problem, It's a setup problem.
#include "simpletools.h" // Include simpletools
void hello(void); // Function prototype
int main() // main function
{
hello(); // Call hello function
print("Hello again from main!\n"); // Display message
}
Thanks you.
Please give us consistent information otherwise we cannot help. Your original error message refers to line 36, but your hello program only has 9 lines !
When I compile that code in SimpleIDE I get:
Which is understandable because you have a declaration for he function "hello" but no definition for it.
#include "simpletools.h" // Include simple tools
int main() // Main function
{
//#USE DELAY (CLOCK=4000000)
void main() {
output_low(pin_C1);
output_high(pin_C1);
}
and got the same;
propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2162)
propeller-elf-gcc.exe -I . -L . -I ../Learn/Simple Libraries/Utility/libsimpletools -L ../Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Users/greg/Documents/SimpleIDE/Learn/Simple Libraries/Simple Libraries/Utility/libsimpletools -L C:/Users/greg/Documents/SimpleIDE/Learn/Simple Libraries/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Users/greg/Documents/SimpleIDE/Learn/Simple Libraries/Simple Libraries/Text Devices/libsimpletext -L C:/Users/greg/Documents/SimpleIDE/Learn/Simple Libraries/Simple Libraries/Text Devices/libsimpletext/cmm/ -I C:/Users/greg/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Users/greg/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -o cmm/Welcome.elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 Welcome.c -ltiny -lsimpletools -ltiny -lsimpletools -lsimpletext -lsimplei2c -ltiny -ltiny -lsimpletools -ltiny -lsimpletools -lsimpletext -lsimplei2c -ltiny -lsimpletools -ltiny -lsimpletools -lsimpletext -ltiny -lsimpletools -ltiny -lsimpletools -ltiny -lsimpletools -ltiny -ltiny -lsimpletools -ltiny
Welcome.c: In function 'main':
Welcome.c:33:2: warning: implicit declaration of function 'output_low' [-Wimplicit-function-declaration]
Welcome.c:33:13: error: 'pin_C1' undeclared (first use in this function)
Welcome.c:33:13: note: each undeclared identifier is reported only once for each function it appears in
Welcome.c:34:2: warning: implicit declaration of function 'output_high' [-Wimplicit-function-declaration]
Welcome.c: In function 'main':
Welcome.c:36:1: error: expected declaration or statement at end of input
What is your SimpleIDE version? See menu "help -> about". I have version 0.9.43.
Your propgcc version is "propellergcc_v1_0_0_2162" where I have "propellergcc-alpha_v1_9_0_2214"
What OS are you on, Linux, Mac or Windows. I only have Linux here.
Where did you get "output_low", "output_high" and "pin_C1" from? My installation does not have that in Welcome.c and I can't find those strings anywhere in the install directory or the propgcc directory.
'output_high(pin_C1);'.
Ray
Phew!
Can you confirm which download version you have that now works ?