I tried making this simple static library in Code::Blocks with MinGW:
#include <time.h>
#include <sys/time.h>
#include "header.h"
extern int go(int x)
{
struct timeval t;
gettimeofday(&t, NULL);
return 1;
}
This same snippet works if compiled as a console app (with printf), but when compiled as a static library, the calling code keeps getting this error:
unresolved external symbol "_gettimeofday"