Can't get even basic math functions working
Posted: 31 Jan 2012, 19:51
Hi,
I downloaded the latest nxc hardware onto my brick from http://bricxcc.sourceforge.net/test_releases/ but I still cannot use even basic maths functions like floor. Also, I am unable to use some NXC-specific functions like FormatNum.
My current program
fails with message 'Undefined identifier floor'
I am compiling the program on MacOSX using the following makefile:
I am not sure what to do, could you please help? I am obviously missing something.
I downloaded the latest nxc hardware onto my brick from http://bricxcc.sourceforge.net/test_releases/ but I still cannot use even basic maths functions like floor. Also, I am unable to use some NXC-specific functions like FormatNum.
My current program
Code: Select all
task main()
{
int y = floor(23.0);
}
I am compiling the program on MacOSX using the following makefile:
Code: Select all
# Config
USB=-U
# Path to the NXC compiler relative to the Makefile
NXC=/Developer/SDKs/nxt/nbc
NXTCOM=/Developer/SDKs/nxt/nxtcom
# Options to pass to the compiler
OPTIONS=-Z2 -I=../$(SOURCE)/
# Program settings
SOURCE=source
BUILD=build
PROGRAM=MyProject
############
all: $(PROGRAM).rxe download
$(PROGRAM).rxe: $(SOURCE)/$(PROGRAM).nxc Makefile
cd $(SOURCE); \
$(NXC) -O=../$(BUILD)/$(PROGRAM).rxe \
$(OPTIONS) \
$(PROGRAM).nxc
download: $(PROGRAM).rxe
cd $(BUILD); \
$(NXTCOM) $(USB) $(PROGRAM).rxe
clean:
/bin/rm -vf build/$(PROGRAM).rxe