Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: DBS on November 24, 2010, 08:38:17 pm
-
I use Code::blocks 10.05 on Win 7 Professional with gnu gcc cygwin 1.7. Some errors are displayed like this: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before â€
I have fixed the code problem, but I am still unable to decode this message. I have seen an earlier response to a similar question on this Forum, but it did not help to me. What settings control the build messages encoding?
Many Thanks.
-
I am seeing the same problem. Did you manage to solve it?
-
Have you checked your locale settings?
What is the output when you execute gcc/g++ from the command line/shell?
-
Don't forget cygwins locale settings, too.
-
Have you checked your locale settings?
What is the output when you execute gcc/g++ from the command line/shell?
The problem is for utf8 coded characters (fancy unicode quotes around error messages) produced by cygwin gcc. The text inside the quotes is OK (regular us-en). I couldn't find the character encoding for build log (there is one only for input files into editor). Here is an example of a gcc message output:
C:\C\exp\cyg\main.c||In function ‘ticks2’:|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 2 has type ‘time_t’|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 3 has type ‘long int’|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 2 has type ‘time_t’|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 3 has type ‘long int’|
||=== Build finished: 0 errors, 4 warnings ===|
As you can see only the unicode quotes (in utf8) were not understood by the CB Build log display. Compiling from command line in cygwin shell produces correct output:
C:/C/exp/cyg/main.c: In function `ticks2':
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 2 has type `time_t'
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 3 has type `long int'
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 2 has type `time_t'
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 3 has type `long int'
-
My guess:
the problem is, that cygwin does not use the system default encoding, but C::B does (for logger).
This works in cygwin-shell (of course), but not from inside C::B.
If you turn on full commandline logging and type the exact same command as C::B uses in a normal windows console and see the results.
-
Try setting the environment variable LC_ALL to 'C' from within code::blocks and run it again
Eran
-
Try setting the environment variable LC_ALL to 'C' from within code::blocks and run it again
Eran
Thanks, that fixed it!