Menu

#91 float unknow by compiler

compiler
closed-works-for-me
NXC (53)
5
2011-02-03
2011-02-03
Anonymous
No

I use nbc complier with linux Ubuntu.
When i declare a float variable, the compiler don't recognize the instruction.

by exemple if i declare a variable
float x;

The result after compilation is :
# Error: Undefined Identifier float
File "/home/vigne/Documents/LEGO FLOU/NXC/test.nxc" ; line 3
# float
#----------------------------------------------------------
# Error: Undeclared identifer: float
File "/home/vigne/Documents/LEGO FLOU/NXC/test.nxc" ; line 3
# float
#----------------------------------------------------------
# Error: '=' expected
File "/home/vigne/Documents/LEGO FLOU/NXC/test.nxc" ; line 3
# float x;

What is the problem?
Thanks

Discussion

  • John Hansen

    John Hansen - 2011-02-03

    You either need a newer version of the compiler or you need to tell the compiler that you are targetting version 1.28 or higher of the NXT firmware. Try adding -v=128 to the command line.

    nbc -v=128

    The most recent version of the compiler uses 128 as the default target version so you may not have the latest.

     
  • John Hansen

    John Hansen - 2011-02-03
    • status: open --> closed-works-for-me