Code::Blocks Forums

User forums => Help => Topic started by: CuteAlien on May 11, 2008, 04:06:28 am

Title: How to get rid of mixed english-german compiler messages?
Post by: CuteAlien on May 11, 2008, 04:06:28 am
I get currently errors like that one when compiling my applications:

error: calling fdopen: Ungültiger Dateideskriptor

Part english, part german. The reason is probably that I've set german as my system language. But I prefer programming in 100% english environments, as I'm used to that a lot more. I could get rid of the those menus which had been translated by starting with:
LANG=en_US '/opt/codeblocks-8.02/bin/codeblocks'

But I still get those half-german errors and I didn't find out how to stop that.

I'm running codeblocks 8.02 and it's running on a debian sid clone (kanotix).
My compiler is g++ (and it usually is giving me english errors).
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: MortenMacFly on May 11, 2008, 09:02:44 am
But I still get those half-german errors and I didn't find out how to stop that.
I believe the compiler have their localised language files somewhere under /share/... under Linux. You just need to remove the language file and all is English only. But I don't know exactly where the file is I am not using Linux anymore. But that's how I did it back in the days.
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: thomas on May 11, 2008, 11:14:42 am
Unless I'm very mistaken, this is not something the compiler has built in or cares about.

The code probably looks somewhat similar to this:
Code
#define CHECK(x) if(x!= 0) fprintf(sterr, "error: %s : %s", #x, strerror(errno));
...
CHECK(fdopen(fd, "wb"))
It's what makes most sense (actually the only thing that makes sense), because the compiler cannot possibly know the 276,000 reasons why each of the 500 library calls it uses might fail on the 25 platforms it runs on. It is easiest and safest to ask the OS for a human readable string.
Thus, the only thing that will likely help is set the system language accordingly. No worries though, this shold work just fine with Martin's EnvVar plugin (though I'm just guessing, haven't tried).
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: Jenna on May 11, 2008, 11:38:08 am
You can try to set "LC_ALL" in "Settings -> Environment.. ->  Environment variables".
Just click "Add" and take "LC_ALL" as key and your language settings as value. I use "en_US.UTF8" and everything is in english instead of german.
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: CuteAlien on May 11, 2008, 06:56:55 pm
Thanks for the help, I could solve it now. The error message came from usr/share/locale/de/LC_MESSAGES/libc.mo and deleting it (well, renaming for now) did the trick. It's now "bad file descriptor" which was a lot easier to find in google ;-)

I also tried the other stuff, but I failed with that.

Not sure where I could set LC_ALL within c::b, I could not find an environment variables settings in Environment. Setting it manually before start did translate the c::b menus, but not that error message.

Changing system language did for some reason also not do the trick. I've got an English KDE that way, but that error did stay German. Though I only did change the language - not the locale (I didn't want to change stuff like currencies, etc), so that might have worked.

Not sure about that EnvVar plugin, is that something newer than 8.02? I didn't find it.
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: Jenna on May 11, 2008, 07:26:40 pm
Not sure about that EnvVar plugin, is that something newer than 8.02? I didn't find it.

Did you install the "codeblocks-contrib"-package ?

Or if self-compiled: did you run "./contrib --with-contrib-plugins=all" before running "make" ?
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: CuteAlien on May 11, 2008, 08:53:52 pm
Not sure about that EnvVar plugin, is that something newer than 8.02? I didn't find it.

Did you install the "codeblocks-contrib"-package ?

Or if self-compiled: did you run "./contrib --with-contrib-plugins=all" before running "make" ?

Probably I would need to install that. I installed from codeblocks-8.02-src.tar.bz2 and I guess it's not part of that. But as it works now I'm already happy anyway ;-)
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: Jenna on May 11, 2008, 09:04:38 pm
Probably I would need to install that. I installed from codeblocks-8.02-src.tar.bz2 and I guess it's not part of that. But as it works now I'm already happy anyway ;-)

That means you self-compiled C::B.

add "--with-contrib-plugins=all" to your "./configure"-commandline and all the contrib-plugins get compiled when running "make".

If you have compiled C::B with C::B using the project file you also have to build the "ContribPlugins-unix.workspace" too.
Title: Re: How to get rid of mixed english-german compiler messages?
Post by: CuteAlien on May 12, 2008, 05:21:36 pm
Thanks, I'll try that next time I compile it.