CLion GDB received signal?

0

I am trying to run a very simple hello world for SDL. if I execute the program using 'run' it works fine but when I use 'debug' GDB complains about receiving signal ?. Not really sure what I am doing wrong here... I am also new to CLion

main.cpp

#include <iostream>

#define SDL_MAIN_HANDLED
#include <SDL.h>
#include <cstdio>

int main() {
    std::cout << "Hello, World!" << std::endl;
    SDL_Window* window = NULL;

    if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        printf("SDL could not initialize! SDL_Error: %s\n", SDL_GetError());
    } else {
        window = SDL_CreateWindow("SDL Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 700, SDL_WINDOW_SHOWN);
        if (window == nullptr) {
            printf("Window could not be created! SDL_Error: %s\n", SDL_GetError());
        }
        SDL_Delay(2000);
    }
    SDL_DestroyWindow(window);
    SDL_Quit();
    return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.7)
project(SkyGames)

set(CMAKE_CXX_STANDARD 14)

set(SDL2_PATH ${PROJECT_SOURCE_DIR}/Packages/SDL2/i686-w64-mingw32)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}  ${PROJECT_SOURCE_DIR}/cmake)

find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIR})

set(SOURCE_FILES main.cpp Math/sk_math.h)
add_executable(SkyGames ${SOURCE_FILES})
target_link_libraries(SkyGames ${SDL2_LIBRARY})

GDB output

GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
[New Thread 6112.0x1444]
[New Thread 6112.0x30dc]
[New Thread 6112.0x130c]
[New Thread 6112.0x6b4]
[New Thread 6112.0x1820]
gdb: unknown target exception 0x406d1388 at 0x7626a932

Thread 5 received signal ?, Unknown signal.
[Switching to Thread 6112.0x1820]
0x7626a932 in RaiseException () from C:\WINDOWS\System32\KernelBase.dll
c++
gdb
sdl-2
clion
asked on Stack Overflow Apr 17, 2017 by Matthew

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0