Hi all,
I'm using the round function from math.h in a program that runs on the gumstix, however is getting very difficult to compile with my makefile. 
I'm getting always the same error whatever i try to do.

/home/joao/gumstix-buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-g++ -static  -O2 -march=armv5te -mtune=xscale -Wa,-mcpu=xscale  wall.o svn-version.h i2c_connection.o i2c-api.o i2c-io-api.o AvrInfo.o BootLoader-api.o Crc8.o DumpMem.o Log.o myLaserScanner.o Controller.o  -lm -o wall
Controller.o: In function `Controller::p(double, double)':
Controller.cpp:(.text+0xc4): undefined reference to `round'
collect2: ld returned 1 exit status

...with the follow MAKEFILE:

################
#
#    Makefile
#
#
###########

ifeq ($(DEBUG),y)
    CFLAGS += -O -g     # -O is need to expand inlines
else
    CFLAGS += -O2
endif

PWD       := $(shell pwd)

MYNAME = wall

BUILD_ARM        = $(GUMSTIX_BUILDROOT)/build_arm_nofpu
CROSS_COMPILE        = $(BUILD_ARM)/staging_dir/bin/arm-linux-
COMMON            = $(ROBOSTIX_SVN_PATH)/robostix/gumstix/Common
SHARED            = $(ROBOSTIX_SVN_PATH)/robostix/Shared

vpath %.c $(COMMON) $(SHARED)
vpath %.cpp ../i2c_connection

CPPFLAGS += -I . -I $(COMMON) -I $(SHARED) -I ../i2c_connection \
            -I ../Shared -Wall
CFLAGS += -Wall

LDLIBS += -lm

TARGET_ARCH = -O2 -march=armv5te -mtune=xscale -Wa,-mcpu=xscale


CC = $(CROSS_COMPILE)g++ -static
CXX = $(CROSS_COMPILE)g++

OBJS =  $(MYNAME).o \
    i2c_connection.o\
    i2c-api.o\
    i2c-io-api.o\
    AvrInfo.o\
    BootLoader-api.o\
    Crc8.o\
    DumpMem.o\
    Log.o\
    myLaserScanner.o \
    Controller.o
         

#LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)

all: $(MYNAME) 

$(MYNAME): svn-version.h $(OBJS)
clean:
    rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions $(MYNAME)

depend .depend dep: svn-version.h
    @echo "Creating dependencies ..."
    $(CC) $(CFLAGS) $(CPPFLAGS) -M *.c $(COMMON)/*.c > .depend

FORCE:

.PHONY: FORCE

PREPROCESS.c = $(CC) $(CPPFLAGS) $(TARGET_ARCH) -E -Wp,-C,-dD,-dI

%.pp : %.c FORCE
    $(PREPROCESS.c) $< > $@

include $(ROBOSTIX_SVN_PATH)/robostix/svn-version.mk

ifeq ($(strip $(filter clean, $(MAKECMDGOALS))),)
-include .depend
endif



It compiles fine if i take the round function.
The -lm flag is also there, i can't figured out the error.
Can someone help me please!
Thank very much!!!!
joão.











Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça o MSN Mobile! Crie já o seu!


Conheça já o Windows Live Spaces, o site de relacionamentos do Messenger! Crie já o seu!