0

I have written an really basic test application in C with GTK+ 3, but when I want to start this application I'm getting the following error:

The application was unable to start correctly (0xc000007b)

But Im getting this only with GTK+ 3.

My Code:

#include <stdio.h>
#include <gtk/gtk.h>

static void activate(GtkApplication *app, gpointer user_data) {
    GtkWidget *window;

    window = gtk_application_window_new(app);

    gtk_window_set_title(GTK_WINDOW (window), "Tutorial");
    gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);
    gtk_widget_show_all(window);

}

int main(int argc, char **argv) {
    printf("Hello, World!\n");

    //printf("Ein akustisches Signal mit : (\\a)\a");
    printf("\nEin Backspace mit : (\\b) | \bx\n");
    printf("Ein Zeilenvorschub mit : (\\t) |\tx");
    printf("\n\tC\n\ti\n\ts\n\tt\n\ttoll\n");
    printf("\t   u\n\t   n\n\t   d\n");
    printf("\t   macht Spaß\n");

    //Kommentar 1
    /* Kommentar 2 */
    /*
     * Mehrzeiliges Kommentar
     */

    GtkApplication *app;
    int status;

    app = gtk_application_new("org.gtk.example", G_APPLICATION_FLAGS_NONE);

    g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);

    status = g_application_run(G_APPLICATION(app), argc, argv);

    g_object_unref(app);

    return status;
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.7)
project(tutorial)

set(CMAKE_C_STANDARD 99)

set(SOURCE_FILES main.c)

set(PKG_CONFIG_EXECUTABLE "C:/msys64/mingw64/bin/pkg-config.exe")

FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)

INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS})

add_executable(tutorial ${SOURCE_FILES})

ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})

TARGET_LINK_LIBRARIES(tutorial ${GTK3_LIBRARIES})

Im using Clion 2017.1.3, mingw-w64 5.0 and cmake 3.7.2 (x64) with gdb 7.11.1 (x64)

iehrlich
  • 3,572
  • 4
  • 34
  • 43
Nightloewe
  • 918
  • 1
  • 14
  • 24
  • seems closely related (or a duplicate of) https://stackoverflow.com/questions/10492037/the-application-was-unable-to-start-correctly-0xc000007b – thurizas Jul 04 '17 at 21:20
  • It's loading 32 bit DLL's, but I'm using 64 bit cmake and 64 bit gtk library and I have a 64 bit system, so why It's using the 32 bit windows dll's – Nightloewe Jul 04 '17 at 21:25

1 Answers1

0

Ok, I fixed my own bug ^^

I set an GTK_BASEPATH in my system variables and the PATH variable to an old version of GTK (32 bit) and It used these files as library.

Nightloewe
  • 918
  • 1
  • 14
  • 24