Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. GTest subproject doesn't recognize QList class

GTest subproject doesn't recognize QList class

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 383 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • freddy311082F Offline
    freddy311082F Offline
    freddy311082
    wrote on last edited by
    #1

    Hi Guys, sorry if this is a newbie question but I'm not able to make GTest works inside QtCreator.

    I have created a subdir project which looks like:

    TEMPLATE = subdirs
    
    CONFIG += ordered
    
    SUBDIRS += LaMartingala \
        LaMartingalaTests
    

    Then I created my project and inside my I created a .pri file which looks like:

    SOURCES += \
            main.cpp \
            src/finance/instruments/options/CallOption.cpp \
            src/finance/instruments/options/Option.cpp \
            src/service/Service.cpp
    
    HEADERS += \
        src/finance/instruments/options/CallOption.h \
        src/finance/instruments/options/Option.h \
        src/service/Service.h
    
    QT += quickcontrols2 core
    

    Then the test subproject which was created using the GTest template. Its .pro file looks like this:

    include(gtest_dependency.pri)
    include(../LaMartingala/source.pri)
    
    TEMPLATE = app
    CONFIG += console c++11
    CONFIG -= app_bundle
    CONFIG += thread
    CONFIG -= qt
    
    QT += core
    
    HEADERS += \
            tst_binomialtree.h
    
    SOURCES += \
            main.cpp
    

    When I compile the GTest project I got an error saying:

    make[1]: *** No rule to make target src/finance/instruments/options/CallOption.cpp', needed by CallOption.o'. Stop.

    make[1]: *** Waiting for unfinished jobs....
    In file included from ../../LaMartingalaProject/LaMartingalaTests/main.cpp:1:
    In file included from ../../LaMartingalaProject/LaMartingalaTests/tst_binomialtree.h:6:
    ../../LaMartingalaProject/LaMartingalaTests/../LaMartingala/src/service/Service.h:4:10: fatal error: 'QList' file not found
    #include <QList>
             ^~~~~~~
    1 error generated.
    make[1]: *** [main.o] Error 1
    make: *** [sub-LaMartingalaTests-make_first-ordered] Error 2
    

    Any idea hot to make this works inside QtCreator please?

    Regards

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You have CONFIG -= qt in your .pro file. You should remove that line since you are in fact using Qt.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • freddy311082F Offline
        freddy311082F Offline
        freddy311082
        wrote on last edited by
        #3

        Go it!!! it works

        Thanks

        1 Reply Last reply
        1
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since you have it working now, pleas mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved