Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compilation error error C2039: 'clock_t' : is not a member of '`global namespace''

I'm compiling in VS 2010 with boost 1_53. I'm also using boost's threads.

during compilation i'm getting bunch of errors like this

c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(18): error C2039: 'clock_t' : is not a member of '`global namespace''

all errors are about ctime and c_time.hpp.

i've searched around for the solution but without success.

can anyone, please, help?

here some part of code.

#define BOOST_THREAD_USE_DLL 

#include <boost/optional.hpp>
#include <boost/thread.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
like image 600
Nem Avatar asked May 28 '14 08:05

Nem


1 Answers

Something, somewhere in your codebase is including a different "time.h". I just discovered this migrating code from Linux to Windows - Because windows is case insensitive, a local "Time.h" (note the capital) was included as "time.h", causing the error that you see.

According to someone's post, FFMPEG can cause this problem via this precise mechanism.

Please look through your codebase and/or libraries for a "time.h" to see if this is happening. Otherwise, an alternate option is to output the fully pre-processed source to see what is actually being compiled in the offending file.

like image 119
Damien Avatar answered Sep 30 '22 21:09

Damien