[Ace-users] Problem: ISO C++ forbids declaration of `ACE_Cached_Allocator' with no type

comp.soft-sys.ace maxim.bakushin at gmail.com
Wed Nov 21 13:26:47 CST 2007


On Nov 21, 9:07 pm, "Johnny Willemsen" <jwillem... at remedy.nl> wrote:
> Hi,
>
> Thanks for using the PRF form. Have you build this code already with msvc or
> regular GCC? Remove the include of vxworks.h (not needed on vxworks also)
> and fix the issues reported my msvc/gcc first
>
> Regards,
>
> Johnny Willemsen
> Remedy IT
> Postbus 101
> 2650 AC  Berkel en Rodenrijs
> The Netherlandswww.theaceorb.nl/www.remedy.nl 
>
> *** Integrated compile and test statistics seehttp://scoreboard.theaceorb.nl***
> *** Commercial service and support for ACE/TAO/CIAO             ***
> *** Seehttp://www.theaceorb.nl/en/support.html                ***
>
> "comp.soft-sys.ace" <maxim.bakus... at gmail.com> wrote in message
>
> <news:c35d2ee8-464d-4a68-bfb8-edb991a05c84 at e1g2000hsh.googlegroups.com>...
>
>
>
> > ACE VERSION: 5.6
> > HOST MACHINE and OPERATING SYSTEM:    Windows XP/ VxWorks 6.4
> > COMPILER NAME AND VERSION (AND PATCHLEVEL): GCC 3.4
> > THE $ACE_ROOT/ace/config.h FILE : #include "ace/config-vxworks6.4.h"
> > THE $ACE_ROOT/include/makeinclude/platform_macros.GNU
> > FILE :platform_macros.GNU
> > DESCRIPTION:
> > building PPC603gnu/Test.o
> > Test.cpp:12: error: ISO C++ forbids declaration of
> > `ACE_Cached_Allocator' with no type
> > Test.cpp:12: error: expected `;' before '<' token
> > C:\WindRiver\vxworks-6.4\host\x86-win32\bin\make.exe: *** [PPC603gnu/
> > Test.o] Error 1
>
> > In order to reproduce the problem, the following C++ code was written:
> > #include <vxworks.h>
> > #include <ace/os_ns_thread.h>
>
> > class A
> > {
> > public:
> >    A() {};
> >    virtual ~A() {};
>
> > public:
> >    typedef ACE_Cached_Allocator< typename(A), ACE_Thread_Mutex >
> > Allocator;
> >    static Allocator* allocator_;
> > };
>
> > What is the problem with declaration of a variable ? Anybody faced
> > such a problem ?
> > If you need more details, please let me know.
> > Please advise.
> > Thanks in advance.
> > maximb- Hide quoted text -
>
> - Show quoted text -

Johnny, thanks for response.

1. I did not compiled this source with MSVC. I do not have ACE
customized and compiled for WinXP, but only for VxWorks 6.4. My target
machine runs VxWorks 6.4.
2. This code was compiled successfully before under VxWorks 5.5.1 with
Wind River - supplied GCC 2.96.
3. After removing the #include <vxworks.h> directive, I've got the
same errors.
4. Additionally, I have tried to declare and instantiate a STL vector
instead of ACE_Cached_Allocator - the code was compiled without any
problem.

Any suggestions / opinions ?

Thanks in advance.
maximb


More information about the Ace-users mailing list