Thread: Compilation Error

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    7

    Compilation Error

    Hi,

    I'm new to c programming language.
    I trying to compile a project. but I get a compilation error.

    ||=== , Debug ===|
    C:\Users\Windows\..\common\..\Windows\ostypes.h|57 |error: expected '=', ',', ';', 'asm' or '__attribute__' before 'bit64'|

    If this is a not a valid question or If I did not provide the right information please excuse me.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    It would help if we could see a bit of the code you are referencing there.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    May 2011
    Posts
    7
    typedef _int64 bit64;
    [/B]typedef unsigned int bit32;
    typedef unsigned short bit16;
    typedef unsigned char bit8;

    typedef bit32 HBA_HANDLE;
    typedef bit32 agStatus_t;
    typedef bit32 agBoolean;

    the compiler points to the first line as error. I'm using code blocks to compile it. should I use any header file to get through this error?

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    _int64 is not a standard type. I think windows.h defines it, so perhaps you were expected to have that header file first (just based on your path anyway, that seems reasonable).

  5. #5
    Registered User
    Join Date
    May 2011
    Posts
    7
    I have it included

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Try __int64 instead, or use long long if you can compile with respect to C99.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Do you have it included before this header?

    Actually, upon review of the documentation, it appears that Microsoft's version is __int64, with two underscores.

    You should be able to replace _int64 with "long long".

  8. #8
    Registered User
    Join Date
    May 2011
    Posts
    7
    Great. It did work.

    The _ _int64 keyword declares a new type, a 64-bit (8-byte) integer.

    So this specific to only windows right?

  9. #9
    Registered User
    Join Date
    May 2011
    Posts
    7
    Thank you.

  10. #10
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    That is definitely windows-only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error: was not declared in this scope compilation error
    By i_r_tomash in forum C Programming
    Replies: 2
    Last Post: 05-27-2010, 07:44 AM
  2. compilation error using std::map
    By dbeyer in forum C++ Programming
    Replies: 8
    Last Post: 03-02-2006, 04:10 PM
  3. compilation error
    By blue_gene in forum C++ Programming
    Replies: 2
    Last Post: 04-13-2004, 07:26 AM
  4. compilation error
    By blue_gene in forum C++ Programming
    Replies: 1
    Last Post: 12-28-2003, 12:49 AM
  5. Error with compilation
    By mattbrrtt in forum C Programming
    Replies: 0
    Last Post: 01-08-2002, 04:44 AM

Tags for this Thread