控制台上的gcc编译输出消息中出现奇怪的字符 [英] Strange characters present in gcc compilation output message on console

查看:184
本文介绍了控制台上的gcc编译输出消息中出现奇怪的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用gcc构建C代码时,在Ubuntu 10.04-x32位系统下的Makefile如下,在bash shell下。 gcc输出消息在输出消息中有一些不需要的字符(见下文:)。



pre $ test $ dualboot-desktop:〜〜 / test / opencv $ make
cc -L / usr / local / lib -I / usr / local / include / opencv2 -lopencv_imgproc -lopencv_highgui -lopencv_video -lopencv_calib3d test1.c -o test_opencv
test1.c :在函数中:
test1.c:13:错误:函数的参数太少vLoadImageâ
test1.c:21:error:expectedâ;“cvMoveWindowâ
make:*** [test_opencv]错误1

有时他们会混淆实际的消息并讨厌。 b
$ b

原因是什么?在我的ubunti用户设置中有任何问题



我该如何解决这个问题?

解决方案

如果您将LC_LANG设置为以UTF8结尾的内容,但终端出现问题(或未配置为处理)UTF8,则会遇到麻烦。 >配置您的终端或设置LC_LANG = en_GB。


When I build a C code using gcc, Makefile as below on a Ubuntu 10.04-x32 bit system, under bash shell. The gcc output message has some unwanted characters in the output message(see below: â).

test@dualboot-desktop:~/test/opencv$ make
cc -L/usr/local/lib -I/usr/local/include/opencv2 -lopencv_imgproc -lopencv_highgui -lopencv_video -lopencv_calib3d test1.c -o test_opencv
test1.c: In function âmainâ:
test1.c:13: error: too few arguments to function âcvLoadImageâ
test1.c:21: error: expected â;â before âcvMoveWindowâ
make: *** [test_opencv] Error 1

They jumble up the actual message sometimes and get pesky.

What is the cause of that? Anything wrong in my user settings on ubunti

How can I fix that?

解决方案

If you set LC_LANG to something that ends in UTF8 but your terminal is having problems (or is not configured to handle) UTF8, then you run into trouble.

Either configure your terminal or set LC_LANG=en_GB.

这篇关于控制台上的gcc编译输出消息中出现奇怪的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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