[aspectc-user] Compiling helloworld aspect C++ on Symbian

Marti Bayo-alemany malemany at nero.com
Mon Sep 5 12:18:40 CEST 2005


Hi all,
I have tried to use the STU mode but it is actually not working.
The command is the following ...
..\..\ac\ac++  -g -p source  -c source\helloworld_application.cpp  -o 
helloworld-out\helloworld_application.cpp -e 
cpp --skip-bodies-non-prj --no_problem_spec_scope --gnu-2.95 -d 
..\helloworld-out -I.  -D_DEBUG -D_UNICODE -D__SYMBIAN32__ -D__GCC32__ -D__EPOC32__ 
 -D__MARM__ -D__MARM_ARMI__ -D__DLL__ -I"C:\Symbian\7.0s\Series60_v20\Epoc32\include\"

With the WPT mode the compiler is trying to include the aspect.ah from 
source. Due aspect.ah is not a c++ files there is compilation problems.

I have tested on the following two paths structures

symbian|
            |->helloworld(*)|---->source
                                     |---->helloworld-out

... and ...

symbian|
            |->helloworld(*)|---->source
            |
            |->helloworld-out

and I get the following errors
>>                 from source/helloworld_application.cpp:14:
>> source/aspect.ah:4: syntax error before `{' token
>> source/aspect.ah:7: syntax error before `.' token
>> source/aspect.ah:8: ISO C++ forbids declaration of `Write' with no type
>> source/aspect.ah:8: `int RFileLogger::Write' is not a static member of 
>> `class
>>   RFileLogger'
>> source/aspect.ah:8: initializer list being treated as compound expression
>> source/aspect.ah:8: cannot convert `TPtrC' to `int' in initialization
>> source/aspect.ah:10: syntax error before `->' token
>> source/aspect.ah:12: syntax error before `.' token
>> source/aspect.ah:13: ISO C++ forbids declaration of `Write' with no type
>> source/aspect.ah:13: `int RFileLogger::Write' is not a static member of 
>> `class
>>   RFileLogger'
>> source/aspect.ah:13: initializer list being treated as compound 
>> expression
>> source/aspect.ah:13: cannot convert `TPtrC' to `int' in initialization
>> source/aspect.ah:15: parse error before `}' token

It looks like is trying to include source/aspect.ah !!!
Any idea ?
best wishes,
Marti
----- Original Message ----- 
From: "Olaf Spinczyk" <Olaf.Spinczyk at informatik.uni-erlangen.de>
To: "Marti Bayo-alemany" <malemany at nero.com>
Cc: <aspectc-user at aspectc.org>
Sent: Friday, September 02, 2005 3:51 PM
Subject: Re: [aspectc-user] Compiling helloworld aspect C++ on Symbian


> Hi,
>
> I don't know if it is related to your problem but the command line ...
>
> ..\..\ac\ac++ -p 
> . --skip-bodies-non-prj --no_problem_spec_scope --gnu-2.95 -d 
> helloworld-out -I.  -D_DEBUG -D_UNICODE -D__SYMBIAN32__ -D__GCC32__ -D__EPOC32__ 
>  -D__MARM__ -D__MARM_ARMI__ -D__DLL__
>
> ... which I found in your previous mail is not correct:
>
> You are using the Whole Program Transformation mode here (see Compiler 
> Manual) and the destination directory (-d option) is a subdirectory of the 
> source directory (-p option). This might cause trouble! Better use -d 
> ../somedirectory.
>
> Olaf
>
> Marti Bayo-alemany wrote:
>> Hi,
>>
>> It was nice :-) It worked if I set up that ...
>>  advice execution("% CEXampleApplication::%(...)") : around()  {
>> Now I set up ...
>>  advice execution("% CEXampleApplication::%(...)") : around()  {
>> and I've got some problems...
>>
>> In file included from :1,
>>                 from source/helloworld_application.cpp:14:
>> source/aspect.ah:4: syntax error before `{' token
>> source/aspect.ah:7: syntax error before `.' token
>> source/aspect.ah:8: ISO C++ forbids declaration of `Write' with no type
>> source/aspect.ah:8: `int RFileLogger::Write' is not a static member of 
>> `class
>>   RFileLogger'
>> source/aspect.ah:8: initializer list being treated as compound expression
>> source/aspect.ah:8: cannot convert `TPtrC' to `int' in initialization
>> source/aspect.ah:10: syntax error before `->' token
>> source/aspect.ah:12: syntax error before `.' token
>> source/aspect.ah:13: ISO C++ forbids declaration of `Write' with no type
>> source/aspect.ah:13: `int RFileLogger::Write' is not a static member of 
>> `class
>>   RFileLogger'
>> source/aspect.ah:13: initializer list being treated as compound 
>> expression
>> source/aspect.ah:13: cannot convert `TPtrC' to `int' in initialization
>> source/aspect.ah:15: parse error before `}' token
>>
>> The aspect.ah code is the following...
>>
>> #include <flogger.h>
>> #include <e32std.h>
>>
>> aspect Action {
>>  advice execution("% CExampleApplication::%(...)") : around()  {
>>    TBuf<100> l_Message;
>>    l_Message.Format(_L("CExampleApplication: before(exec) 
>> %s\n"),JoinPoint::signature());
>> 
>> RFileLogger::Write(_L("NSTMLogDir"),_L("AspectsTest"),EFileLoggingModeOverwrite,_L("Test")); 
>> tjp->proceed();
>>
>>    l_Message.Format(_L("CExampleApplication: after(exec) 
>> %s\n"),JoinPoint::signature());
>> 
>> RFileLogger::Write(_L("NSTMLogDir"),_L("AspectsTest"),EFileLoggingModeOverwrite,_L("Test")); 
>>  }
>> };
>>
>> Best regards,
>> Marti
>>
>> ----- Original Message ----- From: "Olaf Spinczyk" 
>> <Olaf.Spinczyk at informatik.uni-erlangen.de>
>> To: "Marti Bayo-alemany" <malemany at nero.com>
>> Cc: <aspectc-user at aspectc.org>
>> Sent: Friday, September 02, 2005 3:33 PM
>> Subject: Re: [aspectc-user] Compiling helloworld aspect C++ on Symbian
>>
>>
>>> Hi,
>>>
>>> Marti Bayo-alemany wrote:
>>>> It seems that Aspect C++ doesn't support __declspec(dllexport)  which 
>>>> is needed in order to get an application running on Symbian
>>>>  #define *EXPORT_C* __declspec(dllexport)
>>>> EXPORT_C CApaApplication* NewApplication()
>>>>  I get that ...
>>>> invalid declaration near token `dllexport'
>>>>  I comment the EXPORT_C before ac++ and I added after EXPORT_C manually 
>>>> to the file generated.
>>>
>>> you should try to generate your parser configuration file with
>>>
>>> ag++ -o <parser config file> --gen_config --c_compiler <your g++>
>>>
>>> I guess, that __declspec is predefined as __attribute__ by the symbian 
>>> g++. Generating the config file will retrieve all the predefined macros 
>>> and include files from g++.
>>>
>>>> The application compiles and it runs on the mobile phone.
>>>>  However is still not doing what I am expecting but I am on the way.
>>>
>>> Fine, it seems that you have faster success than Bil one year ago.
>>>
>>> Best regards,
>>>
>>> Olaf
>>>
>>>
>>
>> _______________________________________________
>> aspectc-user mailing list
>> aspectc-user at aspectc.org
>> http://www.aspectc.org/mailman/listinfo/aspectc-user
>
>
> 




More information about the aspectc-user mailing list