Results 1 to 5 of 5

Thread: standard library error

  1. #1

    standard library error

    I was just compiling a program using visual studio C++ and it gave me an errror saying that size_t was not part of the standard library. Explaining a little bit more in the C standard library there is a standard type size_t which can only be assigned a positive int number.
    I have a line of code saying
    typedef std::size_t size_type;

    which defined the size type as size_t, It didnt give me any errors while running on linux however in visual studio I get an error saying
    error C2039: 'size_t' : is not a member of 'std'
    Does this mean that maybe my standard libraries in visual studio need an update or is there any other reason why it is giving me this error


    Thanx in advance byeeee
    I Speak in frequencies even dogs have trouble hearing


  2. #2

  3. #3
    THANX for the post but Im still confused jeje Ill try to update my libraries and see what happens
    I Speak in frequencies even dogs have trouble hearing


  4. #4
    Senior Member
    Join Date
    Mar 2003
    Posts
    245
    size_t is part of the ANSI C Standard Library, and is of type unsigned int. Check with Microsoft if there are any updates to your libraries and headers that corrects this deviation from ANSI C.
    Get OpenSolaris http://www.opensolaris.org/

  5. #5
    Senior Member
    Join Date
    Jun 2003
    Posts
    236
    youve assigned size_t tp the namespace std. *nix might have just ignnored the namespace and just used the size_t while the windows compiler is a little more stringent.

    all size_t is is an usigned ing why dont you just use

    typedef unsigned int size_type

    *ing should have been int
    That which does not kill me makes me stronger -- Friedrich Nietzche

Posting Permissions

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