Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fail on OS X - no matching constructor for initialization of 'const QVector<double>' #3355

Closed
kination opened this issue Feb 14, 2017 · 6 comments

Comments

@kination
Copy link

kination commented Feb 14, 2017

Hello,
As written in title, I failed on build on mac OSX.

...
In file included from /Users/kwangin/workspace/lmms/src/gui/editors/AutomationEditor.cpp:65:
/Users/kwangin/workspace/lmms/include/debug.h:37:10: warning: 'assert' macro redefined [-Wmacro-redefined]
        #define assert(x) ((void)(x))
                ^
/usr/include/assert.h:56:9: note: previous definition is here
#define assert(e)       ((void)0)
        ^
/Users/kwangin/workspace/lmms/src/gui/editors/AutomationEditor.cpp:78:41: error: no matching constructor for
      initialization of 'const QVector<double>'
const QVector<double> AutomationEditor::m_zoomXLevels =
                                        ^
/opt/local/include/QtCore/qvector.h:122:5: note: candidate constructor not viable: requires 2 arguments, but 7
      were provided
    QVector(int size, const T &t);
...
1 warning and 1 error generated.
make[2]: *** [src/CMakeFiles/lmmsobjs.dir/gui/editors/AutomationEditor.cpp.o] Error 1
...

This is when I run cmake.

Configuring LMMS
--------------------------
* Project version             : 1.2.0-rc2.44
*   Major version             : 1
*   Minor version             : 2
*   Release version           : 0
*   Stage version             : rc2
*   Build version             : 44
*

Optional Version Usage:
--------------------------
*   Override version:           -DFORCE_VERSION=x.x.x-x
*   Ignore Git information:     -DFORCE_VERSION=internal

PROCESSOR: x86_64
Machine: x86_64-apple-darwin14.5.0
-- Target host is 64 bit
-- Found Qt translations in /opt/local/share/qt4/translations
-- checking for module 'carla-standalone>=1.9.5'
--   package 'carla-standalone>=1.9.5' not found
-- Found STK: /usr/local/lib/libstk.a
-- Could NOT find SOUNDIO (missing:  SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR) 
-- Found OggVorbis: /usr/local/lib/libogg.dylib;/usr/local/lib/libvorbis.dylib;/usr/local/lib/libvorbisfile.dylib;/usr/local/lib/libvorbisenc.dylib
-- checking for module 'gig'
--   package 'gig' not found
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 

Installation Summary
--------------------
* Install Directory           : /Users/kwangin/workspace/lmms/target

Supported audio interfaces
--------------------------
* ALSA                        : <not supported on this platform>
* JACK                        : OK
* OSS                         : <not found or not supported on this platform>
* Sndio                       : 
* PortAudio                   : OK
* libsoundio                  : not found, please install libsoundio if you require libsoundio support
* PulseAudio                  : <not supported on this platform>
* SDL                         : OK

Supported MIDI interfaces
-------------------------
* ALSA                        : <not supported on this platform>
* OSS                         : <not found or not supported on this platform>
* Sndio                       : 
* JACK                        : OK
* WinMM                       : <not supported on this platform>
* AppleMidi                   : OK

Supported file formats for project export
-----------------------------------------
* WAVE                        : OK
* OGG/VORBIS                  : OK

Optional plugins
----------------
* Carla Patchbay & Rack       : not found, please install the latest carla
* SoundFont2 player           : 
* Stk Mallets                 : OK
* VST-instrument hoster       : 
* VST-effect hoster           : 
* CALF LADSPA plugins         : OK
* CAPS LADSPA plugins         : OK
* CMT LADSPA plugins          : OK
* TAP LADSPA plugins          : OK
* SWH LADSPA plugins          : OK
* GIG player                  : not found, libgig needed for decoding .gig files


-----------------------------------------------------------------
IMPORTANT:
after installing missing packages, remove CMakeCache.txt before
running cmake again!
-----------------------------------------------------------------

Is there something I am missing?
Thanks.

@tresf
Copy link
Member

tresf commented Feb 14, 2017

Probably an outdated Qt version. @djKooks are you compiling using MacPorts or Homebrew (or other?)

Please read this bug report: #1633

Things to consider...

I assume you're hitting a non-C++11 constructor error, which should be handled already here with the line ADD_DEFINITIONS(-std=c++0x).

  • Is this an older build environment that you've recently pulled code down for which may require deleting CMakeCache.txt or is this a fresh clone/fresh build?
  • Can you provide your compiler version using clang --version? Are you running an old SDK or anything special we should know about?
  • Which Qt version?
  • Where did you get Qt from? Is there a chance you are building on MacPorts or some type of system with a non-C++11 build of Qt?

My macOS 10.10 machine:

clang --version
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.4.0
Thread model: posix

@kination
Copy link
Author

@tresf Thank for quick reply! I used Homebrew. I followed instruction on https://github.com/LMMS/lmms/wiki/Compiling-lmms-(Apple).
Please refer the versions I used.

kwangin-ui-MacBook-Pro:~ kwangin$ qmake --version
QMake version 2.01a
Using Qt version 4.8.6 in /opt/local/lib
kwangin-ui-MacBook-Pro:~ kwangin$ clang --version
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

Thanks.

@tresf
Copy link
Member

tresf commented Feb 14, 2017

@djKooks it appears to be picking up a non-Homebrew version of Qt (Homebrew wouldn't install to /opt, however Qt Creator may have).

Can you try to follow the instructions for Qt5? I think specifying Qt5 will fix it up inadvertently and not mess with whatever the other version is for.

If you don't need the /opt version you may decide to remove it which should also fix the problem however since it's finding Qt4 which we're moving away from, the Qt5 instructions should hit two birds, so to speak.

@kination
Copy link
Author

@tresf Thanks! I'll try and let you know.

@jasp00
Copy link
Member

jasp00 commented Feb 15, 2017

Your Qt environment does not enable the constructor. This is why the Clang build for Qt4 was dropped in #3208.

@follower
Copy link
Contributor

FWIW I just encountered this same error after deleting CMakeCache.txt which apparently caused cmake to be run again but without the same parameters as I provided originally (cmake .. -DCMAKE_INSTALL_PREFIX=../target -DWANT_QT5=True -DCMAKE_BUILD_TYPE=Debug -DWANT_SWH=OFF).

Fortunately I'd just seen this issue and so worked out the cause.

I wonder if there's some way to not have this happen or at least warn about it?

BTW thanks for mentioning using qmake --version to determine which Qt version is being used:

$ qmake --version
QMake version 2.01a
Using Qt version 4.8.6 in /usr/local/Cellar/qt/4.8.6/lib

(Side note: I deleted CMakeCache.txt because I couldn't work out why the new Eq plugin wasn't being built... I eventually realised that it was because I was using make lmms which doesn't rebuild the plugins. Whoops. :) )

@kination kination closed this as completed Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants