Global Locale Warning using C++ and gtkmm

388 views Asked by At

I'm working on a gui using gtkmm and everything is working, but I get a warning that I can't figure out:

** (process:28120): WARNING **: 13:08:38.752: Can't set the global locale to the user's preferred locale.
   locale::facet::_S_create_c_locale name not valid
   The environment variable LANG may be wrong.


** (process:28120): WARNING **: 13:08:38.813: Can't make the global C++ locale equal to the C locale.
   locale::facet::_S_create_c_locale name not valid
   C locale = English_United States.1252


(Kuaiji.exe:28120): GLib-GIO-WARNING **: 13:08:41.007: C:\Program Files\Git\usr\bin\gdbus.exe dbus binary failed to launch bus, maybe incompatible version

What does this mean, and how do I fix it?

Other info:

OS Name: Microsoft Windows 10 Home

OS Version: 10.0.19044 Build 19044

g++ Version: (Rev10, Built by MSYS2 project) 11.2.0

If you would like the project files to mess with yourself, let me know.

enter image description here

Edit 1: Below is the code for the project as it is now.

mainWindow.cc

// project includes
#include "MainWindow.h"

// other includes
#include <iostream>
#include <string>



//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
// Constructors
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



//**************************************************************************************************
//
// Window Class Constructor
//
//**************************************************************************************************
MainWindow::MainWindow():
    tempNum(0),
    m_Pane_Top(Gtk::Orientation::HORIZONTAL),
    m_Box_Left(Gtk::Orientation::VERTICAL),
    m_Box_Right(Gtk::Orientation::VERTICAL),
    m_Box_AccountSelect(Gtk::Orientation::VERTICAL),
    m_Box_AccountInfo(Gtk::Orientation::VERTICAL),
    m_Box_AddTransaction(Gtk::Orientation::VERTICAL),
    m_Label_AccountSelectLabel("Account Select " + std::to_string(tempNum)),
    m_Frame_AccountSelectFrame(),
    m_Box_AccountSelectorInner(Gtk::Orientation::HORIZONTAL),
    m_Label_AccountSelectorInner("Account: "),
    m_Label_ComboBoxPlaceholderTemp("PLACEHOLDER"), // TODO: Repace with Combo Box
    m_Label_AccountName("Name: "),
    m_Label_AccountNumber("Number: "),
    m_Label_AccountFundsAvailable("Available Funds: "),
    m_Label_AccountDescription("Description: "),
    m_button("Button 1")
{
    // Manage Window
    set_title("Kuaiji - FSAE Accountant");
    set_default_size(1200,500);
    set_child(m_Pane_Top);

    m_Pane_Top.set_margin(10);
    m_Pane_Top.set_wide_handle(true);

    // Manage Pane Top
    m_Pane_Top.set_start_child(m_Box_Left);
    m_Pane_Top.set_end_child(m_Box_Right);
    
    m_Box_Left.set_expand(true);
    m_Box_Right.set_expand(true);
    
    // Manage Box Left -> Pane Top
    m_Box_Left.append(m_Box_AccountSelect);
    m_Box_Left.append(m_Box_AccountInfo);
    m_Box_Left.append(m_Box_AddTransaction);

    // Manage Box AccountSelect -> Box Left
    m_Box_AccountSelect.append(m_Label_AccountSelectLabel);
    m_Box_AccountSelect.append(m_Frame_AccountSelectFrame);

    m_Frame_AccountSelectFrame.set_margin(10);

    m_Label_AccountSelectLabel.set_halign(Gtk::Align::START);
    
    // Manage Frame AccountSelectFrame
    m_Frame_AccountSelectFrame.set_child(m_Box_AccountSelectorInner);

    // Manage Box AccountSelectorInner
    m_Box_AccountSelectorInner.append(m_Label_AccountSelectorInner);
    m_Box_AccountSelectorInner.append(m_Label_ComboBoxPlaceholderTemp);

    m_Label_AccountSelectorInner.set_hexpand(true);
    m_Label_AccountSelectorInner.set_margin(5);
    m_Label_ComboBoxPlaceholderTemp.set_hexpand(true);
    m_Label_ComboBoxPlaceholderTemp.set_margin(5);

    // Manage Box AccountInfo -> Box Left
    m_Box_AccountInfo.append(m_Label_AccountName);
    m_Box_AccountInfo.append(m_Label_AccountNumber);
    m_Box_AccountInfo.append(m_Label_AccountFundsAvailable);
    m_Box_AccountInfo.append(m_Label_AccountDescription);

    // Manage Box AddTransaction -> Box Left

    // Manage Box Right -> Pane Top
    m_Box_Right.append(m_button);

    m_button.set_expand(true);
    m_button.set_margin(10);
    m_button.signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onClick_button));
}



//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
// Signal Handlers
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



//**************************************************************************************************
//
// button onClick signal handler
//
//**************************************************************************************************
void MainWindow::onClick_button()
{
    tempNum++;
    m_Label_AccountSelectLabel.set_markup("<span foreground=\"blue\" weight=\"bold\">Account Select " + std::to_string(tempNum) + "</span>");
}



//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
// Support Functions
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

mainWindow.h

#ifndef MAIN_WINDOW
#define MAIN_WINDOW

// gtkmm includes
#include <gtkmm/window.h>
#include <gtkmm/button.h>
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <gtkmm/frame.h>
#include <gtkmm/paned.h>

class MainWindow : public Gtk::Window
{
public:
    MainWindow();

protected:
// Data items
    int tempNum;
// GUI items
    // Main Window
    Gtk::Paned m_Pane_Top;
    
    // Box_Top
    Gtk::Box m_Box_Left;
    Gtk::Box m_Box_Right;

    // Box_Left
    Gtk::Box m_Box_AccountSelect;
    Gtk::Box m_Box_AccountInfo;
    Gtk::Box m_Box_AddTransaction;

    // Box_AccountSelect
    Gtk::Label m_Label_AccountSelectLabel;
    Gtk::Frame m_Frame_AccountSelectFrame;

    // Frame_AccountSelectFrame
    Gtk::Box m_Box_AccountSelectorInner;

    // Box_AccountSelectorInner
    Gtk::Label m_Label_AccountSelectorInner;
    Gtk::Label m_Label_ComboBoxPlaceholderTemp; // TODO: replace with combo box

    // Box_AccountInfo
    Gtk::Label m_Label_AccountName;
    Gtk::Label m_Label_AccountNumber;
    Gtk::Label m_Label_AccountFundsAvailable;
    Gtk::Label m_Label_AccountDescription;

    // Box_Right
    Gtk::Button m_button;
    void onClick_button();

};

#endif //MAIN_WINDOW

main.cc

// project includes
#include "mainWindow.h"

// gtkmm includes
#include <gtkmm/application.h>

int main (int argc, char *argv[])
{
    // Didn't put the example thing here...
    auto app = Gtk::Application::create();

    return app->make_window_and_run<MainWindow>(argc,argv);
}
0

There are 0 answers