[aspectc-user] Re: Using aspect c++ in symbian

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Sep 2 11:47:43 CEST 2005


Hi Marti,

I've gone through all these problems in 2004 with Bil Lewis from Nokia 
already. Maybe you can get his results from Nokia (I already gave you 
the pointer in a separate mail).

First of all, use the following command line options of ac++:

--skip-bodies-non-prj --no_problem_spec_scope

and for g++ compilation:  --gnu-2.95
     for VC++ compilation: --vc

The C++ language used for Symbian is a mixture of the VC++ and g++ 
dialect. Therefore you need these options.

Furthermore, look into the parser configuration file that comes with the 
Visual Studio .NET Addin.

Best regards,

Olaf


Marti Bayo-alemany wrote:
> Hi all,
> 
>      
>     How are you doing ?
>     I found out that some of you compile Aspect C++ for symbian.
>     I am trying to do the same but I am not successful until now.
>      
>     My issues are the following (Sorry It is actually a really
>     long history) ...
>      
>     I am trying to compile the example that come with AC called
>     Action. Using the plugin for Visual Studio .NET 2003 it is working
>     really good.
>     I will compile now from command line...
>     *1. Way using C:\Symbian\7.0s\Series60_v20\Epoc32\include\libc for
>     the headers file.*
> 
>     C:\MySource\ac>ac++ -p examples\Action -d examples\Action-out
>     -Iexamples\Action -v9
>     -I"C:\Symbian\7.0s\Series60_v20\Epoc32\include\libc"
> 
>     * Running ac++ 0.9.3
> 
>     * Simple Dependency Check
> 
>     - new or modified: examples/Action/Action.ah
> 
>     * Handling Translation Unit `main.cc'.
> 
>     - Path "examples/Action/main.cc"
> 
>     - Inserting namespace AC
> 
>     - Parsing ...
> 
>     C:/Symbian/7.0s/Series60_v20/Epoc32/include/libc/stddef.h:13: error:
>     `signed' or `unsigned' invalid for given type
> 
>     C:/Symbian/7.0s/Series60_v20/Epoc32/include/libc/stdio.h:121: error:
>     invalid declaration near token `FILE'
> 
>     C:/Symbian/7.0s/Series60_v20/Epoc32/include/libc/stdio.h:122: error:
>     invalid declaration near token `FILE'
> 
>     C:/Symbian/7.0s/Series60_v20/Epoc32/include/libc/stdio.h:123: error:
>     invalid declaration near token `FILE'
> 
>     C:/Symbian/7.0s/Series60_v20/Epoc32/include/libc/stdio.h:133: error:
>     invalid declaration near token `FILE'
> 
>     ....
> 
>     *2. Way using C:\Program Files\Microsoft Visual Studio .NET
>     2003\Vc7\include for the headers file.*
> 
>     C:\MySource\ac>ac++ -p examples\Action -d examples\Action-out
>     -Iexamples\Action -v9 -I"C:\Program Files\Microsoft Visual Studio
>     .NET 2003\Vc7\include"
>      
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>       - new or modified: examples/Action/Action.ah
>     * Handling Translation Unit `main.cc'.
>       - Path "examples/Action/main.cc"
>       - Inserting namespace AC
>       - Parsing ...
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:70: error: invalid declaration near token
>     `unsigned'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:286: error: invalid declaration near token
>     `__cdecl'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:292: error: invalid declaration near token
>     `__cdecl'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:313: error: invalid declaration near token `,'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:314: error: invalid declaration near token `*'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:318: error: invalid declaration near token
>     `const'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:326: error: invalid declaration near token `*'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:361: error: invalid declaration near token `*'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:366: error: `swprintf' already defined
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:363: previously defined here
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:371: error: invalid declaration near token `*'
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:376: error: `vswprintf' already defined
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:373: previously defined here
>     C:/Program Files/Microsoft Visual Studio .NET
>     2003/Vc7/include/stdio.h:381: error: invalid declaration near token
>     `const'
>       - Aborting
>      
>     *3. Way using "C:\Program Files\Microsoft Visual Studio\VC98\Include"*
>     C:\MySource\ac>ac++ -p examples\Action -d examples\Action-out
>     -Iexamples\Action -v9 -I"C:\Program Files\Microsoft Visual
>     Studio\VC98\Include"
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>       - new or modified: examples/Action/Action.ah
>     * Handling Translation Unit `main.cc'.
>       - Path "examples/Action/main.cc"
>       - Inserting namespace AC
>       - Parsing ...
>       - Setting Aspect Access Priviledges ...
>       - Weaving Introductions ...
>       - intros for Action
>       - intros for ActionB
>       - Aspect ordering ...
>       - Final checks before weaving introductions
>       - Class Join Points
>       - Weaving Advice Declarations ...
>         Action::%a0_around
>         Action::%a1_around
>         ActionB::%a0_around
>         ActionB::%a1_around
>       - Weaving Singleton Aspects ...
>       - Aspect Includes ...
>       - Commiting
>       - Parsing again ...
>       - Weaving Join Points ...
>         Advicecode manipulation
>         Collecting Advice
>           Setting up thisJoinPoint for aspectof
>           Supplying aspectof() with JoinPoint and tjp if needed
>           Action: __a0_around
>             Evaluate Pointcut
>           Action: __a1_around
>             Evaluate Pointcut
>           Setting up thisJoinPoint for aspectof
>           Supplying aspectof() with JoinPoint and tjp if needed
>           ActionB: __a0_around
>             Evaluate Pointcut
>           ActionB: __a1_around
>             Evaluate Pointcut
>         Aspect ordering ...
>         Final checks before weaving code join points
>         Type Check Functions
>         Call Join Points
>           int A::a(int,float)
>           void b(char,char *)
>         Execution Join Points
>           int A::a(int,float)
>           void b(char,char *)
>         Construction Join Points
>         Destruction Join Points
>       - Aspect Includes ...
>       - Final cleanup
>       - Commiting
>     * Handling include files
>       - Handling Translation Unit `ac_gen.cc'.
>         Path "examples/Action/ac_gen.cc"
>         Inserting namespace AC
>         Parsing ...
>         Setting Aspect Access Priviledges ...
>         Weaving Introductions ...
>         intros for Action
>         intros for ActionB
>         Aspect ordering ...
>         Final checks before weaving introductions
>         Class Join Points
>         Weaving Advice Declarations ...
>           Action::%a0_around
>           Action::%a1_around
>           ActionB::%a0_around
>           ActionB::%a1_around
>         Weaving Singleton Aspects ...
>         Aspect Includes ...
>         Commiting
>         Parsing again ...
>         Weaving Join Points ...
>           Advicecode manipulation
>           Collecting Advice
>             Setting up thisJoinPoint for aspectof
>             Supplying aspectof() with JoinPoint and tjp if needed
>             Action: __a0_around
>               Evaluate Pointcut
>             Action: __a1_around
>               Evaluate Pointcut
>             Setting up thisJoinPoint for aspectof
>             Supplying aspectof() with JoinPoint and tjp if needed
>             ActionB: __a0_around
>               Evaluate Pointcut
>             ActionB: __a1_around
>               Evaluate Pointcut
>           Aspect ordering ...
>           Final checks before weaving code join points
>           Type Check Functions
>           Call Join Points
>           Execution Join Points
>           Construction Join Points
>           Destruction Join Points
>         Aspect Includes ...
>         Final cleanup
>         Commiting
>     * Saving
>       - Project tree
>     * Done
>      
>     With the last one I get a processed cc file on the Action-out directory.
>     It could be that the issues arise because I am trying to compile a
>     non symbian code, action example, with a symbian stdio.h header. 
>      
>     *Another Way, using the makefile***
>     Following I tested to use the makefile.
>     A pumavc6.cfg was created with the following lines...
>     -A machine(i386)
>     -A plattform(win32)
>     -D __cplusplus
>     -D _WIN32
>     -D __cplusplus
>     -D _WCHAR_T_DEFINED
>     -D _M_IX86
>     -D _MSC_VER=1300
>     -D __STDC__
>     -I"C:\Program Files\Microsoft Visual Studio\VC98\Include"
>      
>     Make was executed then succesfully except with the observer pattern
>     example.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/Action -pexamples/Action
>     -dexamples/Action-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Saving
>     * Done
>     copy examples\Action\Makefile examples\Action-out\Makefile
>             1 file(s) copied.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/CFlow -pexamples/CFlow
>     -dexamples/CFlow-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Saving
>     * Done
>     copy examples\CFlow\Makefile examples\CFlow-out\Makefile
>             1 file(s) copied.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/Cache -pexamples/Cache
>     -dexamples/Cache-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Saving
>     * Done
>     copy examples\Cache\Makefile examples\Cache-out\Makefile
>             1 file(s) copied.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/FigureObserver
>     -pexamples/FigureObserver -dexamples/FigureObserver-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Saving
>     * Done
>     copy examples\FigureObserver\Makefile
>     examples\FigureObserver-out\Makefile
>             1 file(s) copied.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/ID -pexamples/ID
>     -dexamples/ID-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Saving
>     * Done
>     copy examples\ID\Makefile examples\ID-out\Makefile
>             1 file(s) copied.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/IconCache
>     -pexamples/IconCache -dexamples/IconCache-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Saving
>     * Done
>     copy examples\IconCache\Makefile examples\IconCache-out\Makefile
>             1 file(s) copied.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/Instances
>     -pexamples/Instances -dexamples/Instances-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Saving
>     * Done
>     copy examples\Instances\Makefile examples\Instances-out\Makefile
>             1 file(s) copied.
>     ac++ -v1 --config pumavc6.cfg -Iexamples/ObserverPattern
>     -pexamples/ObserverPattern -dexamples/ObserverPattern-out
>     * Running ac++ 0.9.3
>     * Simple Dependency Check
>     * Handling Translation Unit `AnalogClock.cc'.
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdlib.h:260:
>     error: invalid declaration near token `void'
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdlib.h:261:
>     error: invalid declaration near token `void'
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdlib.h:353:
>     error: invalid declaration near token `void'
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/eh.h:67:
>     error: invalid declaration near token `void'
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/eh.h:68:
>     error: invalid declaration near token `void'
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/xtree:68:
>     error: `iterator' has no member named `_Ptr'
>     C:\Symbian\7.0s\Series60_v20\epoc32\tools\make.exe: ***
>     [ObserverPattern.make] Error 1
>      
>     After that, I've gotten a Makefile into the Action-out directory.
>     The makefile is the following ...
>     C:\MySource\ac\examples\Action-out>type Makefile
>     CXX ?= cl
>      
>     action: main.cc
>             $(CXX) $(CXXFLAGS) -o action main.cc -I"C:\Program
>     Files\Microsoft Visual Studio\VC98\Include"
>      
>     I get however extrange errors with the spaces on the path.
>      
>     C:\MySource\ac\examples\Action-out>make
>     C:\Symbian\7.0s\Series60_v20\epoc32\tools\make.exe: *** No rule to
>     make target `/Program', needed by `main.cc'.  Stop.
>      
>     I tried then to use the following command ...
>      
>     C:\MySource\ac\examples\Action-out>cl  -o action main.cc
>     -I"C:\Program Files\Microsoft Visual Studio\VC98\Include"
>      
>     I get then the following result ...
> 
>     Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804
>     for 80x86
>     Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
>      
>     Command line warning D4024 : unrecognized source file type
>     'main.cc', object file assumed
>     Microsoft (R) Incremental Linker Version 6.00.8447
>     Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
>      
>     /out:main.exe
>     /out:action.exe
>     main.cc
>     main.cc : fatal error LNK1136: invalid or corrupt file
>      
>     So I rename the main.cc to main.cpp and try again.
>     I get now a different error.
>     C:\MySource\ac\examples\Action-out>cl  -o action main.cpp
>     -I"C:\Program Files\Microsoft Visual Studio\VC98\Include"
>     Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804
>     for 80x86
>     Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
>      
>     main.cpp
>     (6) : error C2252: 'JPID' : pure specifier can only be specified for
>     functions
>     (7) : error C2258: illegal pure syntax, must be '= 0'
>     (7) : error C2252: 'JPTYPE' : pure specifier can only be specified
>     for functions
>     (4) : error C2100: illegal indirection
>     (4) : error C2100: illegal indirection
>     (4) : error C2664: '__exec_old_a' : cannot convert parameter 1 from
>     'void *' to 'int'
>             This conversion requires a reinterpret_cast, a C-style cast
>     or function-style cast
>     (4) : fatal error C1903: unable to recover from previous error(s);
>     stopping compilation
>     I've just found a bat file inside
>     C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
>     ... which it is called ... vcvars32.bat
>      
>     I executed that script from the comand line and then I execute ...
> 
>     C:\MySource\ac\examples\Action-out>cl  -o action main.cpp
>     -I"C:\Program Files\Microsoft Visual Studio\VC98\Include"
>     Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077
>     for 80x86
>     Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
>      
>     main.cpp
>     Microsoft (R) Incremental Linker Version 7.10.3077
>     Copyright (C) Microsoft Corporation.  All rights reserved.
>      
>     /out:main.exe
>     /out:action.exe
>     main.obj
>      
>     So I get a main.exe with the headers from "C:\Program
>     Files\Microsoft Visual Studio\VC98\Include" and the compiler VC7.
>     !!!????
>      
>     The result is the following ...
>     C:\MySource\ac\examples\Action-out>action
>     A: before(call) int A::a(int,float)
>     that  : 00000000
>     target: 0012FEE3
>     B: before(call) int A::a(int,float)
>     that  : 00000000
>     target: 0012FEE3
>     A: before(exec) int A::a(int,float)
>     that  : 0012FEE3
>     target: 0012FEE3
>     B: before(exec) int A::a(int,float)
>     that  : 0012FEE3
>     target: 0012FEE3
>     inside A::a(4711, 3.140000)
>     B: after(exec) int A::a(int,float)
>     A: after(exec) int A::a(int,float)
>     B: after(call) int A::a(int,float)
>     A: after(call) int A::a(int,float)
>     A: before(call) void b(char,char *)
>     that  : 00000000
>     target: 00000000
>     B: before(call) void b(char,char *)
>     that  : 00000000
>     target: 00000000
>     A: before(exec) void b(char,char *)
>     that  : 00000000
>     target: 00000000
>     B: before(exec) void b(char,char *)
>     that  : 00000000
>     target: 00000000
>     inside b(H, ello World)
>     B: after(exec) void b(char,char *)
>     A: after(exec) void b(char,char *)
>     B: after(call) void b(char,char *)
>     A: after(call) void b(char,char *)
>      
>     The problem actually is that I cannot get the gcc to compile the
>     code which I need to compile for ARM processors.
>     If I try to use GCC I get the problem which follows ...
>      
>     C:\MySource\ac\examples\Action-out>gcc -o action main.cpp
>     -I"C:\Program Files\Microsoft Visual Studio\VC98\Include"
>     gcc.exe: Files\Microsoft: No such file or directory
>     gcc.exe: Visual: No such file or directory
>     gcc.exe: Studio\VC98\Include: No such file or directory
>     In file included from :1:
>     examples/Action/Action.ah:1:19: stdio.h: No such file or directory
>     examples/Action/main.cc:1:19: stdio.h: error 0
>      
>     C:\MySource\ac\examples\Action-out>gcc --version
>     3.0-psion-98r2
>     I test another way. I set up the path as follows ...
>     C:\MySource\ac\examples\Action-out>set
>     PATH=C:\Symbian\7.0s\Series60_v20\Epoc32\tools;%PATH%
>      
>     At that moment the make.exe from symbian will be used.
>     I get then a different error from the make utility.
>      
>     C:\MySource\ac\examples\Action-out>make
>     gcc  -o action main.cpp -I"C:\Program Files\Microsoft Visual
>     Studio\VC98\Include"
>     In file included from examples/Action/Action.ah:1,
>                      from :1:
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdio.h:23:2:
>     #error ERROR: Only Mac or Win32 targets supported!
>     In file included from examples/Action/Action.ah:1,
>                      from :1:
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdio.h:310:
>     warning: new
>        declaration `int fprintf(FILE*, const char*, ...)'
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdio.h:310:
>     warning: ambiguates
>        built-in declaration `int fprintf(void*, const char*, ...)'
>     make: *** [action] Error 1
>      
>     I add the following to the gcc -D _WIN32.
>     The makefile is now that ...
>     CXX2 ?= gcc
>      
>     action: main.cpp
>      $(CXX2) $(CXXFLAGS) -o action main.cpp -I "C:\Program
>     Files\Microsoft Visual Studio\VC98\Include" -D _WIN32
>      
>     And I get the last  :-) error  which I totally ignore what it is...
>     gcc  -o action main.cpp -I "C:\Program Files\Microsoft Visual
>     Studio\VC98\Include" -D _WIN32
>     In file included from examples/Action/Action.ah:1,
>                      from :1:
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdio.h:310:
>     warning: new
>        declaration `int fprintf(FILE*, const char*, ...)'
>     C:/Program Files/Microsoft Visual Studio/VC98/Include/stdio.h:310:
>     warning: ambiguates
>        built-in declaration `int fprintf(void*, const char*, ...)'
>     /Symbian/7.0s/Series60_v20/Epoc32/gcc/arm-epoc-pe/bin/ld: cannot
>     open crt0.o: No such file or directory
>     collect2: ld returned 1 exit status
>     make: *** [action] Error 1
>      
>      
>     Any idea  what I am doing wrong ? Have you already success to
>     compile projects with aspect c++ for Symbian ? Is it robust enough ?
>      
>     Thanks for any tip.
>     ** 
>     ** 
>     Best wishes,
>     Marti
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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