GTKmm Windows - Glibmm KeyFile Problem



Hello all,

I just started working with Gtkmm on Windows a few days ago, and I can't get Glib::Keyfile to work properly.

If the KeyFile doesn't exist, I want to start a config screen and make one.  Problem is, I can't catch anything from load_from_file, it just seems to blow up.

I found a related item, but it doesn't look like it ever resolved:  http://www.nabble.com/Glib::KeyFile-bug--td18043898.html

The Doc's say  "If the file could not be loaded then a FileError or KeyFileError exception is thrown."

But there doesn't seem to be anything to catch. Anyone have something I'm missing?

Below is my build/run output and the source of my test file.  MSYS/MinGW.

-------------------------------------------------------------------

jmhobbs SETHER ~/w32-light/src
$ g++ -Wall -o example example.cpp `pkg-config gtkmm-2.4 --libs --cflags`

jmhobbs SETHER ~/w32-light/src
$ ./example.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

jmhobbs SETHER ~/w32-light/src
$

-------------------------------------------------------------------

#include <iostream>

#include <glibmm.h>

int main (int argc, char ** argv) {

    Glib::KeyFile config;
   
    try {
        if(!config.load_from_file("fileDoesNotExist.txt"))
            std::cout << "Can't load it!" << std::endl;
    }
    catch (Glib::KeyFileError & e) {
        std::cout << "Caught KeyFileError" << std::endl;
    }
    catch (Glib::FileError & e) {
        std::cout << "Caught FileError" << std::endl;
    }
    catch (Glib::Error & e) {
        std::cout << "Caught Glib::Error" << std::endl;
    }

    return 0;
}

-------------------------------------------------------------------


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]