Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Compiling error qt 5.2.0 os x mavericks



  • Getting this error:

    /Users/eugenekolesnikov/Qt5.2.0/5.2.0/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:52: error: variable has incomplete type 'class Q_WIDGETS_EXPORT'
    class Q_WIDGETS_EXPORT QSizePolicy
    ^

    How to solve that problem?



  • Solved that problem by changing the path of "include" directory.
    But arises another problem:

    :-1: error: symbol(s) not found for architecture x86_64

    QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9 doesn't help....


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    How did you installed Qt ?

    What does your pro file look like ?



  • installed via macports

    .pro file:
    @
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = TestProj
    TEMPLATE = app

    CONFIG += MAC_CONFIG

    MAC_CONFIG {
    QMAKE_CXXFLAGS = -mmacosx-version-min=10.9
    QMAKE_LFLAGS = -mmacosx-version-min=10.9
    }

    INCLUDEPATH += /Users/eugenekolesnikov/Library/OpencvLib
    /usr/local/include
    LIBS +=
    -L/opt/local/lib
    -lopencv_core
    -lopencv_imgproc
    -lopencv_highgui
    -lopencv_objdetect
    -lm

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui
    @

    [edit: added missing coding tags @ SGaist]


  • Lifetime Qt Champion

    Unless you have macports in a strange place, your error says that it's searching in /Users/eugenekolesnikov/Qt5.2.0/5.2.0/clang_64/lib/

    So it seems you have something mixed-up . Did you install Qt through the installer once ?



  • Yes, sorry... my mistake... used macports to install qt4, this one i installed manually or kind of... can't compile from source code, because have this error "clang: error: unsupported option '-static-libgcc'"


  • Lifetime Qt Champion

    How did you "kind of manually" installed it ?



  • I've downloaded dmg file and executed it



  • I think that the problem with opencv lib



  • Compiling from the console I got more words about the error so now it can be analysed:

    Undefined symbols for architecture x86_64:
    "NeuralNet::~NeuralNet()", referenced from:
    MainWindow::MainWindow(QWidget*) in mainwindow.o
    MainWindow::~MainWindow() in mainwindow.o
    MainWindow::~MainWindow() in mainwindow.o
    non-virtual thunk to MainWindow::~MainWindow() in mainwindow.o
    MainWindow::~MainWindow() in mainwindow.o
    non-virtual thunk to MainWindow::~MainWindow() in mainwindow.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [TestGuiProj.app/Contents/MacOS/TestGuiProj] Error 1



  • Finally got this error and I don't know what does that mean

    Undefined symbols for architecture x86_64:
    "NeuralNet::~NeuralNet()", referenced from:
    MainWindow::MainWindow(QWidget*) in mainwindow.o
    MainWindow::~MainWindow() in mainwindow.o
    ld: symbol(s) not found for architecture x86_64


  • Lifetime Qt Champion

    What is NeuralNet ?

    The error means that it can't find the implementation of the destructor of NerualNet for 64 bit


Log in to reply