Originally Posted by
Daved
I don't recognize those names. Could you post the code the error refers to and the lines around it, plus the #includes at the top of the file?
Code:
#include "QRBG.h"
#include <winsock.h>
#include <time.h>
#include <sys/types.h>
#include <string.h> // memcpy
#ifdef PLATFORM_WIN
// windows includes
# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
# include <winsock2.h>
# include <WS2tcpip.h>
# include <windows.h>
# include <errno.h>
// timer start
251:# if defined(PLATFORM_WIN)
252: timeStart = GetTickCount();
253:# elif defined(PLATFORM_LINUX)
254: gettimeofday(&timeStart, NULL);
255:# endif
QRBG.cpp(254) : error C2065: 'timeStart' : undeclared identifier
QRBG.cpp(254) : error C3861: 'gettimeofday': identifier not found
// timer end
267:# if defined(PLATFORM_WIN)
268: timeEnd = GetTickCount();
269:# elif defined(PLATFORM_LINUX)
270: gettimeofday(&timeEnd, NULL);
271:# endif
QRBG.cpp(270) : error C2065: 'timeEnd' : undeclared identifier
QRBG.cpp(270) : error C3861: 'gettimeofday': identifier not found
499:void QRBG::EnsureCachedEnough(size_t size) throw(ConnectError, CommunicationError, ServiceDenied) {
500: // timer reset
501: timeEnd = timeStart;
QRBG.cpp(501) : error C2065: 'timeEnd' : undeclared identifier
QRBG.cpp(501) : error C2065: 'timeStart' : undeclared identifier
530:#elif defined(PLATFORM_LINUX)
531:// linux version
532:
533:double QRBG::getLastDownloadDuration() {
534: return (timeEnd.tv_sec - timeStart.tv_sec) + 1e-6 * (timeEnd.tv_usec - timeStart.tv_usec);
QRBG.cpp(534) : error C2065: 'timeEnd' : undeclared identifier
QRBG.cpp(534) : error C2228: left of '.tv_sec' must have class/struct/union
type is ''unknown-type''
QRBG.cpp(534) : error C2065: 'timeStart' : undeclared identifier
QRBG.cpp(534) : error C2228: left of '.tv_sec' must have class/struct/union
type is ''unknown-type''
QRBG.cpp(534) : error C2065: 'timeEnd' : undeclared identifier
QRBG.cpp(534) : error C2228: left of '.tv_usec' must have class/struct/union
type is ''unknown-type''
QRBG.cpp(534) : error C2065: 'timeStart' : undeclared identifier
QRBG.cpp(534) : error C2228: left of '.tv_usec' must have class/struct/union
type is ''unknown-type''
Generating Code...
C:\QRBG\src>
I cant understand why it keeps going to the code which is meant for linux machines. im running this on win xp.