Errors compiling on OSX (compiler macros?)

Post Reply
mdmayfield
Posts: 69
Joined: Wed Jun 15, 2016 8:51 am
Real Name: Matt Mayfield

Errors compiling on OSX (compiler macros?)

Post by mdmayfield » 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:

Code: Select all

mastertimer-unix.cpp:116:25: error: use of undeclared identifier
      'CLOCK_MONOTONIC'
    ret = clock_gettime(CLOCK_MONOTONIC, finish);
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

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
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

mdmayfield
Posts: 69
Joined: Wed Jun 15, 2016 8:51 am
Real Name: Matt Mayfield

Re: Errors compiling on OSX (compiler macros?)

Post by mdmayfield » Mon Feb 13, 2017 4:11 am

I got past the original error by grepping -r the source tree and manually adding #define Q_OS_OSX to any file that did an #if defined test, but now I'm getting PortAudio related errors. "_Pa_CloseStream", "_Pa_GetDefaultInputDevice", "_Pa_GetDefaultOutputDevice", and several other _Pa* symbols are "not found for architecture x86_64" and causing the linker to fail.

PortAudio is definitely installed:

Code: Select all

Matt-Mayfields-MacBook-Pro:qlcplus mattmayfield$ sudo port install portaudio
Password:
--->  Cleaning portaudio
--->  Scanning binaries for linking errors
--->  No broken files found.
I can't help but feel like I'm missing something obvious and that the #define kludge outlined above shouldn't be necessary. Does anyone have any ideas on how to proceed?

Thanks,

Matt

mlohrey
Posts: 120
Joined: Mon Apr 20, 2015 5:07 am
Real Name: Mark Lohrey

Re: Errors compiling on OSX (compiler macros?)

Post by mlohrey » Mon Feb 13, 2017 6:35 am

This probably doesn't help one little bit ;) , but I have been using Mac OS to compile without issue but am using Mac OS 10.12.6 and Qt 5.7.1.

User avatar
mcallegari
Posts: 1933
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Re: Errors compiling on OSX (compiler macros?)

Post by mcallegari » Mon Feb 13, 2017 1:27 pm

macOS builds on Qt4 are marked as outdated (see Wiki)
Use the Qt5 instructions: https://github.com/mcallegari/qlcplus/wiki

mdmayfield
Posts: 69
Joined: Wed Jun 15, 2016 8:51 am
Real Name: Matt Mayfield

Re: Errors compiling on OSX (compiler macros?)

Post by mdmayfield » Tue Feb 14, 2017 4:50 am

Oops. Thank you, I will try that.

Post Reply