static member initilization

Ian Lance Taylor iant@google.com
Wed Jul 11 09:16:00 GMT 2012


On Wed, Jul 11, 2012 at 2:07 AM, Mohsen Pahlevanzadeh
<mohsen@pahlevanzadeh.org> wrote:
>
> I wrote a Makefile and you compile it just make command.

Thanks.  Next time just create a single file.

This example doesn't compile at all, for reasons that have nothing to
do with anything you were asking about before.  E.g., in test.cpp, you
write "std:endl".  That is not valid C++.

You've been asking about eventList.  The declaration in
eventhandlerabstract.h is:

    static std::vector<std::string> *eventList  ;

The declaration in eventhandlerabstract.cpp is:

template < class Class, typename ReturnType,typename Parameter1  ,
typename Parameter2 , typename Parameter3 , typename Parameter4 >
std::vector<std::string>  EventHandlerAbstract<test,int, int , int,
int , int>::eventList; //specialization

The first is a pointer, the second is not, so you get an error.

As I said earlier, this is not a GCC issue.  This is a C++ issue.
This mailing list is for help with GCC, not for help with C++.
Thanks.

Ian



More information about the Gcc-help mailing list