Dear all, 
I'm having so many problems to embed a C code in a nesC Application.
File: utime.h
unsigned long getTime();
----------------------
File: utime.c
#include<stdlib.h>
#include<sys/time.h>

struct timeval tm;
unsigned long getTime(){
  gettimeofday(&tm, NULL);
  return tm.tv_usec;
}
----------------
Makefile:
COMPONENT = MyAPP
BUILD_EXTRA_DEPS = utime.o
LDFLAGS = utime.o   //I'm not sure about this flag,

utime.o: utime.c utime.h
        gcc -g -c utime.c
-------------------------
MyApp.nc
#include "utime.h"
module MyAppP{
}implementation{

}

Compilation Error:
mkdir -p build/telosb
gcc -g -c utime.c
    compiling SSIC to a telosb binary
ncc -o build/telosb/main.exe -Os -O -mdisable-hwmul -Wall -Wshadow 
-DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=telosb 
-fnesc-cfile=build/telosb/app.c -board= -DIDENT_PROGRAM_NAME=\"SSIC\" 
-DIDENT_USER_ID=\"gonga\" -DIDENT_HOSTNAME=\"gongabgTOS\" 
-DIDENT_USER_HASH=0x56b2c591L -DIDENT_UNIX_TIME=0x4816edcaL 
-DIDENT_UID_HASH=0x00076286L  SSIC.nc -lm utime.o
msp430-ld: utime.o: Relocations in generic ELF (EM: 3)
msp430-ld: utime.o: Relocations in generic ELF (EM: 3)
msp430-ld: utime.o: Relocations in generic ELF (EM: 3)
msp430-ld: utime.o: Relocations in generic ELF (EM: 3)
msp430-ld: utime.o: Relocations in generic ELF (EM: 3)
msp430-ld: utime.o: Relocations in generic ELF (EM: 3)
utime.o: could not read symbols: File in wrong format
make: *** [exe0] Error 1






_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to