I have two projects in my solution; one that creates a static lib, another that uses it and validates it.
I have these linker errors (2019) when using this function in my test application ... but I cannot link other declared things (soley classes) without problems.
The test application depends on the static lib library and has a link to it, so it should reference (I get only this linker error)
Why is this? Am I missing something? I can't think of anything else that could go wrong.
PortableTime.h
#ifndef _PORTABLE_TIME_H
#define _PORTABLE_TIME_H
#if defined _WIN32 || _WIN64
#include <WinSock2.h>
#else
#include <time.h>
#endif
#include <stdint.h>
uint64_t GetTimeSinceEpoch();
#endif
PortableTime.cpp
#include "PortableTime.h"
uint64_t GetTimeSinceEpoch()
{
#if defined _WIN32 || _WIN64
return (uint64_t)timeGetTime();
#else
struct timeval tv;
gettimeofday(&tv, 0);
return (((uint64_t)tv.tv_sec)*(uint64_t)1000) + (((uint64_t)tv.tv_usec)/(uint64_t)1000);
#endif
}
source
share