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

I am compiling in VS 2010 with boost 1_53. I also use boost streams.

during compilation i get a bunch of errors like this

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

all errors are approximately ctime and c_time.hpp .

I was looking for a solution, but to no avail.

can someone please help?

here is some piece 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> 
+7
c ++ boost compiler-errors ctime
source share
1 answer

Something, somewhere in your codebase, there is another "time.h". I just discovered this portable code from Linux to Windows. Since the windows are case-insensitive, the local β€œTime.h” (capital note) was included as β€œtime.h”, resulting in an error.

According to someone post , FFMPEG can cause this problem through this exact mechanism.

Please review your code base and / or libraries for "time.h" to see if this is happening. Otherwise, an alternative is to output the fully pre-processed source to see what is actually compiling in the intruder file.

+10
source share

All Articles