Hi Everyone,
I was wondering if someone could help point out a possible solution to a
problem I have. I have written a component for Nox, which stores flows
to configure the switches and makes decisions on which flows to
implement. The problem I am struggling to get around is that the a user
or admin must be able to add new flows to the configuration table in the
component.
My thought was to write a second program which the user used as an
interface to configure the component and I would do this by passing a
reference of the component to the second program when the component is
created. However, I seem to be stuggling to get my second program to
compile when I add the component header to it. I'm pretty confident this
is a Makefile issue, because I have little experience with that stuff. I
will post the errors I get and the Makefile code for comments, but I was
also wondering if anyone know of a better way to do this? I was thinking
of having my second program inherit from Class Component so I could use
the resolve() function to get a handle on it, but being unfamiliar with
Nox I was not sure whether launching a seperate console UI when
launching Nox was a good idea.
Hope this makes sense! :-s Here is the Makefile stuff:
INCPATH = -I. -I/usr/include/boost -I/home/ben/nox/src/coreapps/
-I/home/ben/nox/src/include -I/home/ben/nox/build $(top_builddir)/
CC = g++
LIBS = -L/usr/lib -lpthread -lrt
TARGET = config_suite
OBJECTS = config_suite.o
/home/ben/nox/build/src/coreapps/test/test_la-test.o
/home/ben/nox/build/src/coreapps/openflow/openflow_manager_la-openflow-1.0.o
/home/ben/nox/build/src/coreapps/openflow/openflow_manager_la-openflow-datapath.o
/home/ben/nox/build/src/coreapps/openflow/openflow_manager_la-openflow-manager.o
CFLAGS=-std=c++0x
all: $(TARGET)
# To create our target we require $(OBJECTS) (main.o) and libopenflow.a
# Run the compilation using main.o to create target.o using all LIBS
$(TARGET): $(OBJECTS) config.h
$(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(LIBS)
config_suite.o: config_suite.cpp
$(CC) $(CFLAGS) -c $(INCPATH) -o config_suite.o config_suite.cpp
clean:
rm -rf *o config_suite
-------------------------------------------------------------------------------------------
Errors:
g++ -std=c++0x -c -I. -I/usr/include/boost -I/home/ben/nox/src/coreapps/
-I/home/ben/nox/src/include -I/home/ben/nox/build / -o config_suite.o
config_suite.cpp
In file included from /home/ben/nox/src/coreapps/test/test.hpp:19:0,
from config_suite.cpp:5:
/home/ben/nox/src/include/netinet++/datapathid.hh: In member function
‘std::string vigil::datapathid::string() const’:
/home/ben/nox/src/include/netinet++/datapathid.hh:148:25: error:
expected ‘)’ before ‘PRIx64’
/home/ben/nox/src/include/netinet++/datapathid.hh:148:42: warning:
conversion lacks type at end of format [-Wformat]
In file included from
/home/ben/nox/src/coreapps/openflow/openflow-1.0.hh:2374:0,
from /home/ben/nox/src/coreapps/openflow/openflow-manager.hh:29,
from /home/ben/nox/src/coreapps/openflow/openflow-datapath.hh:28,
from /home/ben/nox/src/coreapps/openflow/openflow-event.hh:26,
from /home/ben/nox/src/coreapps/test/test.hpp:23,
from config_suite.cpp:5:
/home/ben/nox/src/coreapps/openflow/openflow-inl-1.0.hh: At global scope:
/home/ben/nox/src/coreapps/openflow/openflow-inl-1.0.hh:64:65: error:
ISO C++ forbids in-class initialisation of non-const static member ‘test’
/home/ben/nox/src/coreapps/openflow/openflow-inl-1.0.hh:64:65: error:
template declaration of ‘char vigil::openflow::v1::test’
make: *** [config_suite.o] Error 1
-----------------------------------------------------------------------------------------------------------------
Any thoughts would be greatly received!!
Thanks
Ben