1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to overcome this ERROR

Discussion in 'C' started by Tango Issac Debian, Dec 23, 2006.

  1. Tango Issac Debian

    Tango Issac Debian New Member

    Joined:
    May 3, 2006
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    0
    hallo
    guys please help me how to overcome this problem...

    When i doing to create a .dll project on VC++6.0.......thehe my code structure was that..,,,,, ERROR MESSAGE during compile time is:::fatal error C1010: unexpected end of file while looking for precompiled header directive
    Error executing cl.exe.

    program1::::::The ADLL.cpp
    Code:
    // Adll.cpp : Defines the entry point for the DLL application.
    //
    #include "stdafx.h"
    #include "Header.h"
    
    int addINT(int a,int b){ 
       return add(a,b);
    }
    BOOL APIENTRY DllMain( HANDLE hModule,  DWORD  ul_reason_for_call,   LPVOID pReserved )
    {    return TRUE;
    }
    2)Program ADD.h:::::::::::::::
    Code:
    #ifndef __HEADER_H__
    #define  __HEADER_H__
    #ifdef __cplusplus
    extern "C" {
    #endif
    int add(int ,int);
    #endif 
    #ifdef __cplusplus}
    #endif
    
    3)Program 3))) ADD.c
    #include "Header.h"
    
    int add(int a,int b){
    
      return a+b;
    }<------------------The ERROR position
    The error occured in the LAst file ADD.c


    pls say me what i doing the wrong ....how i will overcome it????
    Thanks
    Tango
     
    Last edited by a moderator: Dec 23, 2006
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Turn off precompiled headers. Re-read the link, "Before you make a query". You seemed to have missed some stuff, as in using code tags.
     
  3. Tango Issac Debian

    Tango Issac Debian New Member

    Joined:
    May 3, 2006
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    0
    Hallo,
    Dawei, Please explain more....I am new in the working with the .dll projects with VC++6.0.
    Thanks
    Tango
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    I have added the code tags for the code block.
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    Try replacing the line
    #ifdef __cplusplus}
    with
    #ifdef __cplusplus
    }

    You are giving an opening { when __cplusplus but not the closing one } for the same I guess.
     

Share This Page