Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    1

    Unhappy Unanswered: error C2501: 'EXEC' : missing storage-class or type specifiers

    Hi, When trying to complie on Visual studio v6
    I get this errors.
    First part of my program is:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>



    /************************************************** ********************/
    /* Input/Output files */
    /* cardin = input request records */
    /* report = output phone report printed to terminal */
    /************************************************** ********************/
    FILE *cardin;
    FILE *report;

    /************************************************** ********************/
    /* Input transaction request from text file TRANSIN (INPUTAREA) */
    /************************************************** ********************/
    EXEC SQL BEGIN DECLARE SECTION;

    char function; /* function code */
    char lname[16]; /* last name */
    char fname[13]; /* first name */
    char eno[7]; /* employee number */
    char pno[5]; /* phone number */
    char dno[4]; /* dept number */
    char mid; /* middle initial */
    EXEC SQL END DECLARE SECTION;



    and the errors I get are:
    c:\Labs\LABPGM2.cxx(38) : error C2146: syntax error : missing ';' before identifier 'SQL'

    C:\Labs\LABPGM2.cxx(38) : error C2501: 'EXEC' : missing storage-class or type specifiers

    C:\Labs\LABPGM2.cxx(38) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.

    LABPGM2.obj - 3 error(s), 0 warning(s)


    Any ideas??

    Cheers

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I am not sure if Visual Studio invokes the DB2 pre-compiler automatically, but you usually need to run a DB2 pre-compile first before you compile.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •