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. “jom.exe exited with code 2” when using headers outside of main.cpp

“jom.exe exited with code 2” when using headers outside of main.cpp

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 150 Views
  • 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.
  • S Offline
    S Offline
    SimonR
    wrote on last edited by
    #1

    I have some trouble getting my application running. When I include the header files for a third-party api, the program throws the following error:
    3407e57c-0e86-4454-8cff-4258b7d23273-image.png

    This is my .pro file:

    QT += quick
    
    CONFIG += c++11
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    
    SOURCES += \
            db.cpp \
            main.cpp
    
    RESOURCES += qml.qrc
    
    QML_IMPORT_PATH =
    
    QML_DESIGNER_IMPORT_PATH =
    
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    HEADERS += \
        db.h
    
    INCLUDEPATH += C:/mongo-cxx-driver-3.4.1/include/bsoncxx/v_noabi \
                   C:/mongo-cxx-driver-3.4.1/include/mongocxx/v_noabi \
                   D:/boost_1_72_0
    
    LIBS += -LC:/mongo-cxx-driver-3.4.1/lib -lbsoncxx \
            -LC:/mongo-cxx-driver-3.4.1/lib -lmongocxx
    

    The code in the file types.hpp at line 39:

    enum class type : std::uint8_t {
    #define BSONCXX_ENUM(name, val) k_##name = val,
    #include <bsoncxx/enums/type.hpp>
    #undef BSONCXX_ENUM
    };
    

    The strange thing is that when I write the class in the main.cpp file, it works. The program also works fine in VS2019.

    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