johmathe / shotdetect

Automated shot detection software
http://johmathe.name/shotdetect.html
Other
199 stars 66 forks source link

Make compile error: "no member named 'clock_t' in the global namespace" and more #1

Closed fergbrain closed 11 years ago

fergbrain commented 11 years ago

When I run make, I get the following errors:

/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the global namespace using ::clock_t; ~~^ /usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global namespace using ::tm; ~~^ /usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global namespace using ::clock; ~~^ /usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the global namespace using ::difftime;

This goes on for 20 errors until the compiler quits. The issues appears to be related to: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/src/film.cc:32: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/./src/film.h:17: In file included from /usr/include/c++/4.2.1/list:65: In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70: In file included from /usr/include/c++/4.2.1/iosfwd:48: In file included from /usr/include/c++/4.2.1/bits/postypes.h:45: In file included from /usr/include/c++/4.2.1/cwchar:51:

I was able to find this thread: http://forum.anope.org/index.php?topic=3710.0 that has a similar issue. I've spent about two hours trying to learn about make, cmake, and the build chain, but i'm not knowledgeable enough yet to solve the problem my self. Have you seen this issue? Any tips on how to resolve it?

johmathe commented 11 years ago

this is a known issue on a recent mac. Are you building with lion or mountain lion?

On Sun, Nov 4, 2012 at 8:42 AM, fergbrain notifications@github.com wrote:

When I run make, I get the following errors:

/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the global namespace using ::clock_t; ~~^ /usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global namespace using ::tm; ~~^ /usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global namespace using ::clock; ~~^ /usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the global namespace using ::difftime;

This goes on for 20 errors until the compiler quits. The issues appears to be related to: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/src/film.cc:32: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/./src/film.h:17: In file included from /usr/include/c++/4.2.1/list:65: In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70: In file included from /usr/include/c++/4.2.1/iosfwd:48: In file included from /usr/include/c++/4.2.1/bits/postypes.h:45: In file included from /usr/include/c++/4.2.1/cwchar:51:

I was able to find this thread: http://forum.anope.org/index.php?topic=3710.0 that has a similar issue. I've spent about two hours trying to learn about make, cmake, and the build chain, but i'm not knowledgeable enough yet to solve the problem my self. Have you seen this issue? Any tips on how to resolve it?

— Reply to this email directly or view it on GitHubhttps://github.com/johmathe/Shotdetect/issues/1.

Johan Mathe Software Engineer - Google

fergbrain commented 11 years ago

Mountain Lion (10.8.2). My short term goal is to write a Homebrew Formula. My long term goal is to use shot detect to help create clips from my parents VHS tapes.

On Sun, Nov 4, 2012 at 9:47 AM, Johan Mathe notifications@github.comwrote:

this is a known issue on a recent mac. Are you building with lion or mountain lion?

On Sun, Nov 4, 2012 at 8:42 AM, fergbrain notifications@github.com wrote:

When I run make, I get the following errors:

/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the global namespace using ::clock_t; ~~^ /usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global namespace using ::tm; ~~^ /usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global namespace using ::clock; ~~^ /usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the global namespace using ::difftime;

This goes on for 20 errors until the compiler quits. The issues appears to be related to: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/src/film.cc:32: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/./src/film.h:17: In file included from /usr/include/c++/4.2.1/list:65: In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70: In file included from /usr/include/c++/4.2.1/iosfwd:48: In file included from /usr/include/c++/4.2.1/bits/postypes.h:45: In file included from /usr/include/c++/4.2.1/cwchar:51:

I was able to find this thread: http://forum.anope.org/index.php?topic=3710.0 that has a similar issue. I've spent about two hours trying to learn about make, cmake, and the build chain, but i'm not knowledgeable enough yet to solve the problem my self. Have you seen this issue? Any tips on how to resolve it?

— Reply to this email directly or view it on GitHub< https://github.com/johmathe/Shotdetect/issues/1>.

Johan Mathe Software Engineer - Google

— Reply to this email directly or view it on GitHubhttps://github.com/johmathe/Shotdetect/issues/1#issuecomment-10053074.

johmathe commented 11 years ago

ok. I don't really have the time to take care of the issue now, especially because I don't have access to mountain lion... I'm pretty sure it's due to some problems in the include paths. Also did you check on forums etc. ? I remember seeing people with similar issues..

On Sun, Nov 4, 2012 at 9:49 AM, fergbrain notifications@github.com wrote:

Mountain Lion (10.8.2). My short term goal is to write a Homebrew Formula. My long term goal is to use shot detect to help create clips from my parents VHS tapes.

On Sun, Nov 4, 2012 at 9:47 AM, Johan Mathe notifications@github.comwrote:

this is a known issue on a recent mac. Are you building with lion or mountain lion?

On Sun, Nov 4, 2012 at 8:42 AM, fergbrain notifications@github.com wrote:

When I run make, I get the following errors:

/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the global namespace using ::clock_t; ~~^ /usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global namespace using ::tm; ~~^ /usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global namespace using ::clock; ~~^ /usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the global namespace using ::difftime;

This goes on for 20 errors until the compiler quits. The issues appears to be related to: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/src/film.cc:32: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/./src/film.h:17: In file included from /usr/include/c++/4.2.1/list:65: In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70: In file included from /usr/include/c++/4.2.1/iosfwd:48: In file included from /usr/include/c++/4.2.1/bits/postypes.h:45: In file included from /usr/include/c++/4.2.1/cwchar:51:

I was able to find this thread: http://forum.anope.org/index.php?topic=3710.0 that has a similar issue. I've spent about two hours trying to learn about make, cmake, and the build chain, but i'm not knowledgeable enough yet to solve the problem my self. Have you seen this issue? Any tips on how to resolve it?

— Reply to this email directly or view it on GitHub< https://github.com/johmathe/Shotdetect/issues/1>.

Johan Mathe Software Engineer - Google

— Reply to this email directly or view it on GitHub< https://github.com/johmathe/Shotdetect/issues/1#issuecomment-10053074>.

— Reply to this email directly or view it on GitHubhttps://github.com/johmathe/Shotdetect/issues/1#issuecomment-10053102.

Johan Mathe Software Engineer - Google

fergbrain commented 11 years ago

I've spent several hours searching, but I'm willing to try to solve the issue. It's been years since I've done any c++, and I've never used cmake or make (I typically program in PHP and mySQL). I'm pretty new to Mac, but always wanting to learn. Did you develop this in Xcode? Any pointers on setting up an IDE?

Sent from my iPhone

On Nov 4, 2012, at 10:44 AM, Johan Mathe notifications@github.com wrote:

ok. I don't really have the time to take care of the issue now, especially because I don't have access to mountain lion... I'm pretty sure it's due to some problems in the include paths. Also did you check on forums etc. ? I remember seeing people with similar issues..

On Sun, Nov 4, 2012 at 9:49 AM, fergbrain notifications@github.com wrote:

Mountain Lion (10.8.2). My short term goal is to write a Homebrew Formula. My long term goal is to use shot detect to help create clips from my parents VHS tapes.

On Sun, Nov 4, 2012 at 9:47 AM, Johan Mathe notifications@github.comwrote:

this is a known issue on a recent mac. Are you building with lion or mountain lion?

On Sun, Nov 4, 2012 at 8:42 AM, fergbrain notifications@github.com wrote:

When I run make, I get the following errors:

/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the global namespace using ::clock_t; ~~^ /usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global namespace using ::tm; ~~^ /usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global namespace using ::clock; ~~^ /usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the global namespace using ::difftime;

This goes on for 20 errors until the compiler quits. The issues appears to be related to: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/src/film.cc:32: In file included from /tmp/shotdetect-W2FZ/Shotdetect-master/./src/film.h:17: In file included from /usr/include/c++/4.2.1/list:65: In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70: In file included from /usr/include/c++/4.2.1/iosfwd:48: In file included from /usr/include/c++/4.2.1/bits/postypes.h:45: In file included from /usr/include/c++/4.2.1/cwchar:51:

I was able to find this thread: http://forum.anope.org/index.php?topic=3710.0 that has a similar issue. I've spent about two hours trying to learn about make, cmake, and the build chain, but i'm not knowledgeable enough yet to solve the problem my self. Have you seen this issue? Any tips on how to resolve it?

— Reply to this email directly or view it on GitHub< https://github.com/johmathe/Shotdetect/issues/1>.

Johan Mathe Software Engineer - Google

— Reply to this email directly or view it on GitHub< https://github.com/johmathe/Shotdetect/issues/1#issuecomment-10053074>.

— Reply to this email directly or view it on GitHubhttps://github.com/johmathe/Shotdetect/issues/1#issuecomment-10053102.

Johan Mathe Software Engineer - Google — Reply to this email directly or view it on GitHub.

ChristianFrisson commented 11 years ago

Look no more, I guess I spotted it. I tried on OSX 10.7.5 and had the same issues as you.

What version of ffmpeg do you have? 1.0 by any chance?

It seems that ffmpeg now ships a header file called "time.h" in libavutil, and the compiler gets to include this one before its own. I made the cmake integration of shotdetect, in OSX 10.6.8, and I used FindFFmpeg.cmake from OpenSceneGraph which reads:

In ffmpeg code, old version use #include <header.h> and newer use #include <libname/header.h>

In OSG ffmpeg plugin, we use #include <header.h> for compatibility with old version of ffmpeg

So I adapted the one forked in shotdetect and just committed the changes. https://github.com/johmathe/Shotdetect/commit/ffb85ed99cb30d0ed292b20fd187017d27e09527

Can you give it a shot?

fergbrain commented 11 years ago

Boom! Problem solved! Thank you so much for helping with this!

On Nov 4, 2012, at 12:57 PM, Christian Frisson notifications@github.com wrote:

Look no more, I guess I spotted it. I tried on OSX 10.7.5 and had the same issues as you.

What version of ffmpeg do you have? 1.0 by any chance?

It seems that ffmpeg now ships a header file called "time.h" in libavutil, and the compiler gets to include this one before its own. I made the cmake integration of shotdetect, in 0SX 10.6.8, and I used FindFFmpeg.cmake from OpenSceneGraph which reads:

In ffmpeg code, old version use "#include " and newer use "#include "

In OSG ffmpeg plugin, we use "#include " for compatibility with old version of ffmpeg

So I adapted the one forked in shotdetect and just committed the changes. johmathe/Shotdetect@ffb85ed

Can you give it a shot?

— Reply to this email directly or view it on GitHub.

ChristianFrisson commented 11 years ago

Great success! :)

Note: to reply one of your questions above: cmake -GXcode <source> generates a project for Xcode of the cmake source code located in <source>.