[aspectc-user] Preprocessing issue with VC7.1
Dmitri Chelenine
dosler at gmx.de
Sun Dec 5 20:29:20 CET 2004
Hi, all!
Just starting a project with aspectc, downloaded the latest code and tried to compile the examples only to learn that they miserably failed with cryptic messages:
E:\<path-to-aspectc>\AspectC++\bin>ac++ -p ..\examples\Action -d ..\examples\Action-out -I..\examples\Action -v9
* Running ac++ 0.9
* 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
E:\<path-to-aspectc>\AspectC++\bin>
The initial contents of pumavc7.cfg were:
-A machine(i386)
-A plattform(win32)
-D __cplusplus
-D _WIN32
-D _WCHAR_T_DEFINED
-D _M_IX86
-D _MSC_VER=1300
-D __STDC__
Taking a look at the stdio.h:70 reveals the following (given w/ appropriate context):
66: #ifndef _SIZE_T_DEFINED
67: #ifdef _WIN64
68: typedef unsigned __int64 size_t;
69: #ielse
70: typedef _W64 unsigned int size_t;
71: #endif
72: #define _SIZE_T_DEFINED
73: #endif
The problem is that _W64 has been previously defined as:
#define _W64 __w64
Where __w64 is a Microsoft VC7.1 specific keyword (consult the msdn for details) that is not understood by the aspectc++.
The solution I found as temporary is to simply append _W64 as a compilation target which will define size_t as unsigned __int64.
I guess, that's a bug or a feature request to fully support the VC7.1.
Hope that helps if anybody has run into the same issue.
P.S. Modified pumavc7.cfg:
-I "c:\program files\microsoft visual studio .net 2003\vc7\PlatformSDK\include"
-I "c:\program files\microsoft visual studio .net 2003\vc7\include"
-A machine(i386)
-A plattform(win32)
-D __cplusplus
-D _WIN32
-D _WIN64
-D _WCHAR_T_DEFINED
-D _M_IX86
-D _MSC_VER=1300
-D __STDC__
Take care, all
Dmitri.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20041205/938367c7/attachment.html>
More information about the aspectc-user
mailing list