Raphael Teyssandier
Raphael Teyssandier

Reputation: 1777

undefined reference to `WinMain@16' with Qt and C-Lion

I didn't see where is my problem in my main. I saw a lot of posts and I don't know where my error is. I know it's a problem with the main. I tried to clean and rebuild (qmake -project and qmake) but it still doesn't work.

int main(int ac, char *av[]) {
    QApplication app(ac, av);

    app.setOrganizationName("Zero");
    app.setApplicationName("Gomoku");

    IntroState *intro = new IntroState();
    if (intro->exec() != QDialog::Accepted)
        return 1;

    GameEngine engine;
    engine.show();

    return app.exec();
}

My CMake is:

cmake_minimum_required(VERSION 2.8)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
project(Gomoku)
set(SOURCE_FILES src/core/IntroState.cpp
                 src/core/GameEngine.cpp
                 src/core/Arbiter.cpp
                 src/tests/CoreFirstRuleTests.cpp)
find_package(Qt5Widgets REQUIRED)
include_directories(include/core
        include/ai
        include/graphic
        include/tests
        include)
set(HW_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${HW_HEADER_DIR})
qt5_wrap_cpp(Gomoku_SRC ${HW_HEADER_DIR}/core/GameEngine.h
        ${HW_HEADER_DIR}/core/IntroState.h)
qt5_wrap_ui(Gomoku_UI
        ${HW_HEADER_DIR}/ui/dialog.ui)
add_executable(Gomoku ${SOURCE_FILES} ${Gomoku_SRC} ${Gomoku_UI})
qt5_use_modules(Gomoku Widgets)

Upvotes: 0

Views: 323

Answers (1)

Raphael Teyssandier
Raphael Teyssandier

Reputation: 1777

Don't forget to add your main at the compilation...

Upvotes: 2

Related Questions