1 Reply Latest reply: Sep 20, 2012 7:28 PM by Mark Williams-Oracle RSS

    pb with pro*C / Oracle 11 / VS2010 on Windows server 2008

    396629
      Hello,
      I am migrating an application from Windows server 2003 / Oracle 10gr2 / Visual Studio 2003 to Windows Server 2008 / Oracle 11gr2 / Visual Studio 2010 and I am having some issue with the compilation of our oci files.
      After fixing the common issue related to path change for Visual Studio, I ran in the following error message while trying to compile one of my file:

      Syntax error at line 48, column 9, file C:\Program Files\Microsoft Visual Studio 10.0\VC\include\vadefs.h:
      Error at line 48, column 9 in file C:\Program Files\Microsoft Visual Studio 10.0\VC\include\vadefs.h
      typedef W64 unsigned int uintptrt;
      ........1
      PCC-S-02201, Encountered the symbol "__w64" when expecting one of the following:

      auto, char, const, double, enum, float, int, long,
      ulong_varchar, OCIBFileLocator OCIBlobLocator,
      OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
      OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
      short, signed, sql_context, sql_cursor, static, struct,
      union, unsigned, utext, uvarchar, varchar, void, volatile,
      a typedef name,
      Syntax error at line 0, column 0, file C:\mgt_sita\Integration\MS\Archive\dev\TOOL\gSGBD\gSGBD.pc:
      Error at line 0, column 0 in file C:\mgt_sita\Integration\MS\Archive\dev\TOOL\gSGBD\gSGBD.pc
      PCC-S-02201, Encountered the symbol "<eof>" when expecting one of the following:

      ; : an identifier, end-exec, random_terminal

      Error at line 0, column 0 in file C:\mgt_sita\Integration\MS\Archive\dev\TOOL\gSGBD\gSGBD.pc
      PCC-F-02102, Fatal error while doing C preprocessing
      Searching on the web lead me first to use a work around to define W64 and _W64, but that only leads to more errors of the same kind after.

      Also, I've found that "Error at line 0, column 0" may be an indication of missing semi-column or brace, but as the source file has not been changed during this migration, it is still syntactically correct as it was compiling with earlier version of pro*c. Of course, I have double checked and I don't think I am missing any obvious brace or semi-column, or coma ...

      Any help or suggestion will be greatly appreciated.

      Thanks

      Eric
        • 1. Re: pb with pro*C / Oracle 11 / VS2010 on Windows server 2008
          Mark Williams-Oracle
          I'm not sure how much help my post will be, but perhaps it will have some value for you.

          There's an unpublished bug on this issue (Bug 10017848 - PRO*C PRECOMPILER CANNOT HANDLE _W64 IN TYPEDEF) but it has not been resolved as of this writing.

          If you are not familiar with the purpose of "__w64" (which has been deprecated) you can see the following in the MS documentation:

          [url http://msdn.microsoft.com/en-US/library/s04b5w00(v=vs.100).aspx]Visual Studio 2010 __w64 description

          Now, one thing that you may be able to use in your situation is to simply make "__w64" an "empty define" at the top of your source file(s) like so:
          #ifdef WIN32
          #define __w64
          #endif
          
          #include <stdio.h>
          #include <string.h>
          #include <stdlib.h>
          #include <sqlca.h>
          #include <sqlda.h>
          #include <sqlcpr.h>
          ... rest of code ...
          Of course the above assumes that WIN32 has been defined - if it has not, you will need to use another symbol, make adjustments, etc.

          As an example:
          proc define=(_WSTDIO_DEFINED,WIN32) code=ansi_c parse=full common_parser=yes atest.pc
          If you have a large amount of files that can be tedious of course but it may be a potential workaround for you.