Shop OBEX P1 Docs P2 Docs Learn Events
error with new IDE download — Parallax Forums

error with new IDE download

gregfoxgregfox Posts: 68
edited 2013-12-29 11:19 in Propeller 1
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!

Comments

  • Hal AlbachHal Albach Posts: 747
    edited 2013-12-26 18:53
    Maybe if you posted your code...???
  • gregfoxgregfox Posts: 68
    edited 2013-12-27 04:29
    Hal Albach wrote: »
    Maybe if you posted your code...???

    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.
  • Heater.Heater. Posts: 21,230
    edited 2013-12-27 04:41
    grefox,

    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:
    Project Directory: /home/heater/crap2/
    
    
    propeller-elf-gcc -v GCC 4.6.1 (propellergcc-alpha_v1_9_0_2214)
    propeller-elf-gcc -I . -L . -I /home/heater/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L /home/heaterl/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/lmm/ -I /home/heater/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext -L /home/heaterr/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext/lmm/ -I /home/heater/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L /home/heater/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/lmm/ -o lmm/crap2.elf -Os -mlmm -Wall -m32bit-doubles -fno-exceptions -std=c99 crap2.c -lsimpletools -lsimpletext -lsimplei2c -lsimpletools -lsimpletext -lsimpletools
    /tmp/cceRtvI4.o: In function `_main':
    (.text+0x10): undefined reference to `_hello'
    collect2: ld returned 1 exit status
    Done. Build Failed!
    
    
    Check source for bad function call or global variable name `_hello'
    

    Which is understandable because you have a declaration for he function "hello" but no definition for it.
  • gregfoxgregfox Posts: 68
    edited 2013-12-27 04:45
    After a new install I ran the welcome program;
    #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
  • Heater.Heater. Posts: 21,230
    edited 2013-12-27 05:26
    OK now I'm confused.

    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.



  • RsadeikaRsadeika Posts: 3,837
    edited 2013-12-27 05:29
    and got the same;
    I am not sure what you are after, why don't you explain what you expect to see. hint- 'output_low(pin_C1);'
    'output_high(pin_C1);'.

    Ray
  • gregfoxgregfox Posts: 68
    edited 2013-12-27 06:23
    Thanks all, I found that the download was corrupted, and after the 3rd download it worked.
  • Heater.Heater. Posts: 21,230
    edited 2013-12-27 06:52
    gregfox,

    Phew!
  • jmgjmg Posts: 15,173
    edited 2013-12-29 11:19
    gregfox wrote: »
    Thanks all, I found that the download was corrupted, and after the 3rd download it worked.

    Can you confirm which download version you have that now works ?
Sign In or Register to comment.