Errors compiling on OSX (compiler macros?)
Posted: Mon Feb 13, 2017 1:19 am
I'm trying to compile the latest source from Git on Mac OS X 10.11.6. So far I've closely followed the instructions here.
Something seems to be wrong with the makefile or some other mechanism by which information is passed to the compiler, and I could use some help diagnosing. Sequence:
1) Clone the source into a local directory
2) cd there
3) /opt/local/libexec/qt4/bin/qmake -spec macx-g++ (this dir is not in my $PATH... though the result is the same whether I call it by absolute path or by putting that dir in $PATH)
4) Makefile is created, apparently correctly
5) make
6) Error in compiling mastertimer-unix.cpp:
I'm inferring from this page that there is no such function as CLOCK_MONOTONIC on OSX. In mastertimer-unix.o there are a bunch of compiler directives like
So apparently for some reason "Q_OS_OSX" is not being recognized as defined. My next step was to add #define Q_OS_OSX to the start of mastertimer-unix.o, and while that gets past the CLOCK_MONOTONIC error, I now see a variety of other errors such as mastertimer-unix.cpp:46:61: error: use of undeclared identifier 'cclock'; did you mean 'clock'?.
I'm guessing from this that there's someplace else with an #if defined(Q_OS_OSX) that's not registering the right OS.
Can anyone suggest a path forward to troubleshooting and resolving this properly? I suspect I'm missing something in the makefile, but am not quite sure where to go from here.
Thanks,
Matt
Something seems to be wrong with the makefile or some other mechanism by which information is passed to the compiler, and I could use some help diagnosing. Sequence:
1) Clone the source into a local directory
2) cd there
3) /opt/local/libexec/qt4/bin/qmake -spec macx-g++ (this dir is not in my $PATH... though the result is the same whether I call it by absolute path or by putting that dir in $PATH)
4) Makefile is created, apparently correctly
5) make
6) Error in compiling mastertimer-unix.cpp:
Code: Select all
mastertimer-unix.cpp:116:25: error: use of undeclared identifier
'CLOCK_MONOTONIC'
ret = clock_gettime(CLOCK_MONOTONIC, finish);
Code: Select all
#if defined(Q_OS_OSX) || defined(Q_OS_IOS)
ret = clock_get_time(cclock, finish);
#else
ret = clock_gettime(CLOCK_MONOTONIC, finish);
#endif
I'm guessing from this that there's someplace else with an #if defined(Q_OS_OSX) that's not registering the right OS.
Can anyone suggest a path forward to troubleshooting and resolving this properly? I suspect I'm missing something in the makefile, but am not quite sure where to go from here.
Thanks,
Matt