Important: Please read the Qt Code of Conduct -

Compile project using CMAKE

  • Hi all,

    I have started to port my project from standard VS to CMAKE definition during the transition to QT5 in order to be system independent. My project is quite huge, basically using Qt5 and VTK6.

    First, my code runs for Windows and I can generate my complete source code and execute it.

    Now I am trying to do the same in linux, and I got some code errors - as expected. After fixing them, I started the the same CMakeLists.txt as in windows, but the linker fails.

    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQt5::Sql
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQt5::OpenGL
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQt5::WebKitWidgets

    Interesting, because my Code does not use any part of Webkit, but if he would like to use it, I try to change the CMAKE file from

    @qt5_use_modules(SoPaRa Core Widgets Xml XmlPatterns)@


    @qt5_use_modules(SoPaRa Core Sql OpenGL WebKitWidgets Widgets Xml XmlPatterns)@

    but that causes new errors of webkit linker
    @Qt5.1.0/5.1.0/gcc_64/lib/ undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
    collect2: ld gab 1 als Ende-Status zurück

    Hm, however, how can I tell CMAKE not to use something like webkit, because I think it is not needed at all (it isnt in windows)

    kind regards,

Log in to reply