When attempting to inherit from AppenderSkeleton I get "error: expected class-name before ‘{’ token " when I attempt to compile. I seems to not be recognizing the class but I am referencing the log4cxx library and have included the appenderskeleton.h file.
The .h file is below:
#include <log4cxx/appenderskeleton.h>
//#include <vector>
#ifndef SERVICEAPPENDER_H_
#define SERVICEAPPENDER_H_
class ServiceAppender : public AppenderSkeleton {
{
public:
ServiceAppender();
virtual ~ServiceAppender();
};
#endif
There is a ServiceAppender.cpp file but currently has nothing in it but a reference to file above. I am using a make file with the following :
CC=g++
CFLAGS=-c
EXECUTABLE=testservice
CPPFLAGS= -I/usr/local/lib -I/usr/include/libxml++-2.6 \
-I/usr/lib/libxml++-2.6/include -I/usr/include/libxml2 \
-I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include \
-I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include \
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
LIBS= -lxml++-2.6 -lxml2 -lglibmm-2.4 -lgobject-2.0 -lsigc-2.0 -lgthread-2.0 \
-lrt -lglib-2.0 -lboost_t开发者_如何学Chread -llog4cxx -lcurlpp -lpthread -lapr-1
It seems I may be missing a library/reference but as c++ noob, I have no idea what that might be.
Is AppenderSkeleton in a namespace by any chance? In that case you'd have to qualify the class name for the compiler to be able to properly resolve the symbol.
精彩评论