Run-Time libraries and Bill Gates

Started by
3 comments, last by dannyxyz23 20 years, 5 months ago
Hallo leute, I tried to use some struct like: __timeb64 in my code: struct __timeb64 timebuffer; and I get a compiler error: d:\labirinto\joy\paralela.cpp(27) : error C2065: ''__time64_t'' : undeclared identifier I included the files #include <stdio.h> #include <sys/timeb.h> #include <time.h> but anyway it does not work... I grabbed the code below from MSDN and it seems it should work, but I get the same error. I''m using Microsoft Visual Studio 6.0... does this things only compile under .NET // crt_ftime.c /* This program uses _ftime64 to obtain the current * time and then stores this time in timebuffer. */ #include <stdio.h> #include <sys/timeb.h> #include <time.h> int main( void ) { struct __timeb64 timebuffer; char *timeline; _ftime64( &timebuffer ); timeline = _ctime64( & ( timebuffer.time ) ); printf( "The time is %.19s.%hu %s", timeline, timebuffer.millitm, &timeline[20] ); }
Advertisement
i'm not sure if you hadn't noticed but the file you've given us is fine, the actual prob appears to be in the source file
d:\labirinto\joy\paralela.cpp at line 27

make sure this file either handles all __time64_t variables as __int64 or include 'time.h' in paralela.cpp or one of the headers it includes (it should also have these two 'sys/types.h' and 'sys/timeb.h')

that should fix the problem

< krysole || krysollix >
sleep, caffeine for the weak minded!


[edited by - krysole on November 11, 2003 12:57:49 AM]
That didn''t solve it...
Take a look at my include in paralela.cpp
#include <stdio.h>
#include <sys/timeb.h>
#include <time.h>
#include "StdAfx.h"
#include "paralela.h"
#include "inpout.h"
and paralela.h has:
#include <stdio.h>
#include <sys/timeb.h>
#include <sys/types.h>
#include <time.h>

By the way, the example from microsoft msdn didn''t work as well...
What does this have to do with the RTM library and Bill Gates? I fail to see the point....

If you take a look at which part of MSDN you copied that sample is from you''ll notice it''s under Visual Studio .NET and not under Visual Studio 6.

The header and library files included with Visual Studio 6 are from 1997 (i.e. ~6 years out of date...) and don''t include the things mentioned in the newer versions of MSDN.

You can get an updated header and relevent file from the Win64 (64bit Windows) folder of newer Platform SDK versions - however this probably won''t help you since CRT function code which understands the new types isn''t likely to be available (or work on non-.NET compilers).


AFAIK __timeb64 and _ftime64 aren''t standard ANSI either - they''re Microsoft additions. They work fine on .NET (VC7).

If you don''t have a compiler that supports those additions, use the older _ftime and _timeb. Your compiler will support those.

--
Simon O''Connor
3D Game Programmer &
Microsoft DirectX MVP

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement