(进程:1477):gtk-WARNING **:C库不支持语言环境。使用后备“C”语言环境。 [英] (Process:1477): gtk-WARNING **: locale not supported by C library. Using the fallback 'C' locale.

查看:193
本文介绍了(进程:1477):gtk-WARNING **:C库不支持语言环境。使用后备“C”语言环境。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于ARM的nanopi-m1板。我已经安装了Armbian(Ubuntu-server 16.04)。我还安装了:

I have an ARM-based nanopi-m1 board. I have installed Armbian(Ubuntu-server 16.04) on it. Also I have installed :

xorg, openbox, xserver-x11-video-fbdev and libgtk-3-dev

。并制作了三个.conf文件:

on it. and made three .conf files:

Add to file /etc/modules-load.d/fbtft.conf

spi-bcm2835

fbtft_device







Add to file /etc/modprobe.d/fbtft.conf

options fbtft_device custom name=fb_ili9341 gpios=reset:1,dc:201,led:6 speed=16000000 rotate=90 bgr=1







Add to file: /usr/share/X11/xorg.conf.d/99-fbdev.conf

Section "Device" Identifier "myfb" Driver "fbdev" Option "fbdev" "/dev/fb8" EndSection









And

Add to /etc/rc.local 
startx





所以我在启动后有这个屏幕: [ ^ ]



这是openbox窗口。



然后我尝试在我的SPI LCD上用.C代码显示图像,如下所示:





So I have this screen after boot: [^]

That is openbox window.

Then I tried to show an image in my SPI LCD with .C code as you can see below:

#include <gtk/gtk.h>

void destroy(void) {
  gtk_main_quit();
}

int main (int argc, char** argv) {
  GtkWidget* window;
  GtkWidget* image;

  gtk_init (&argc, &argv);


  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  image  = gtk_image_new_from_file(argv[1]);

  g_signal_connect(G_OBJECT (window), "destroy",
             G_CALLBACK (destroy), NULL);

  gtk_container_add(GTK_CONTAINER (window), image);

  gtk_widget_show_all(window);

  gtk_main();

  return 0;
}





但是在编译我的代码后没有错误,当我尝试通过ssh运行可执行文件时,它给了我这个消息:





But after compiling my code without error, when I try to run the executable via ssh, it gives me this message:

(process:1909): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.





我的笔记本显示在我的笔记本电脑而不是我的主板液晶显示屏上! />
如何解决此问题?

我希望我的图像显示在我的SPI LCD内,而不是我的笔记本电脑显示屏!



我尝试了什么:



我搜索了很多并在其他一些网站上询问过,但到现在为止找不到任何解决方案!



And my image shown in my laptop instead of my board's LCD!
How can I fix this?
I want my image shown inside my SPI LCD not in my laptop display!

What I have tried:

I searched a lot and asked in some other sites but couldn't find any solution till now!

推荐答案

看起来你已经为笔记本电脑上的SSH客户端启用了X11-Forwarding。然后X11应用程序的输出发送到SSH客户端并在那里显示。



setlocale [ ^ ]函数用于指定如何处理与语言环境相关的值(日期,时间,数值,货币值,排序)以及应使用哪个字符集。默认的C语言环境使用带有ASCII字符集的美国英语设置。



要修复语言环境警告,请参阅
命令行 - Gtk-WARNING **:Locale C库不支持。 `从命令行启动应用程序时 - 询问Ubuntu [ ^ ]。



据我所知GTK将阅读 LC _ * LANG * 环境变量来设置语言环境。使用 printenv(1) - Linux手册页 [ ^ ]显示当前设置并使用 locale(1) - Linux手册页 [ ^ ]使用 -a 选项。
It looks like you have enabled X11-Forwarding for the SSH client on your laptop. Then the output of the X11 application is send to the SSH client and shown there.

The setlocale[^] function of the C library is used to specify how locale dependant values (dates, times, numeric values, monetary values, sorting) are handled and which character set should be used. The default "C" locale uses US English settings with the ASCII character set.

To fix the locale warning see command line - `Gtk-WARNING **: Locale not supported by C library. ` when starting apps from the commandline - Ask Ubuntu[^].

As far as I know GTK will read the LC_* and LANG* environment variables to set the locale. Use printenv(1) - Linux manual page[^] to show your current settings and check the installed languages with locale(1) - Linux manual page[^] using the -a option.


这篇关于(进程:1477):gtk-WARNING **:C库不支持语言环境。使用后备“C”语言环境。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆