Hi all,

I am having some issues compiling a serial communications program in c++ (I am working with 2.1.2, gcc 4.8.2). The issues I am having are horribly basic, but I just can't seem to get the makefile to include the required files.

When I include my mig-generated files, they require the inclusion of message.h. Fair enough. This sends me down a rabbit hole of necessary inclusions, but I have dutifully (and messily, as you can see), included them all. This still leaves me with a huge block of unknown types (tinyos/nesC types, such as serial_packet_t). It seems very unlikely that I need to redefine all of these for C++. It already seems deeply unlikely that I am going about this in the right way.

The most likely hypothesis at this stage is that I am doing something stupid, frankly. I have looked extensively through the available tinyos help documents, and the archives of all the mailing lists, and cannot find anything that has helped. (Dima's example, found here - http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2008-June/034114.html - left me with the same problem, no matter what I did.

My makefile is inserted here, for informational/schaudenfroide purposes:

COMPONENT=MeasurementBaseStationAppC

CFLAGS += -I$(TOSDIR)/lib/net/ -I$(TOSDIR)/lib/net/ctp -I$(TOSDIR)/lib/net/le -I%T/lib/net/drip -DLOW_POWER_LISTENING

BUILD_EXTRA_DEPS += BaseStationCommunicator
CLEAN_EXTRA = BaseStationCommunicator $(patsubst %, BaseStationCommunicator%, .c .h) dataReading*

include $(MAKERULES)

TOSDIR = /opt/tinyos-2.1.2/tos/

OTHERCONST = -I $(TOSDIR)types/ -I $(TOSDIR)platforms/telosb/mac/tkn154/ -I $(TOSDIR)platforms/telosb/mac/tkn154/timer/ -I $(TOSDIR)/lib/serial/ -I $(TOSDIR)/lib/mac/tkn154/ -I $(TOSDIR)/chips/cc2420_tkn154/ -I $(TOSDIR)/../support/sdk/c/sf/

BaseStationCommunicator: CFLAGS += -I/opt/tinyos-2.x/support/sdk/c/sf -g --std=c99
BaseStationCommunicator: LDFLAGS  += -L/opt/tinyos-2.x/support/sdk/c/sf -g

BaseStationCommunicator.o: BaseStationCommunicator.cpp
g++ -c $(OTHERCONST) BaseStationCommunicator.cpp -o BaseStationCommunicator.o

BaseStationCommunicator: BaseStationCommunicator.o dataReading.o
        g++ -o $@ $(LDFLAGS) $^ -lmote

dataReading.c: Collect.h
        mig -o dataReading.h c $^ dataReading
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to