yogi_en
yogi_en

Reputation: 121

C++ Compilation window contains junk characters

I am compiling c++ program using emacs. In the compilation window, I get junk characters. Example given below.

#include <iostream>
#include <string>

using namespace std;


int main()   
{   
 error

}

I am compiling this inside emacs by using compile command as

g++  error.cpp

In the compilation window, I get the following error.

g++ error.cpp 
error.cpp: In function âint main()â:
error.cpp:10:3: error: âerrorâ was not declared in this scope
error.cpp:12:1: error: expected â;â before â}â token

Compilation exited abnormally with code 1 at Wed Jan 23 17:09:17

As you can notice there are some junk characters in the window ( Many of the junks are disappeared during pasting! ). How can avoid this? . I don't see the issue if I do the compilation in a terminal.

I am using emacs 24.1.1 in ubuntu 12.10

Upvotes: 0

Views: 321

Answers (1)

Lindydancer
Lindydancer

Reputation: 26134

In many locales, the gcc compiler emits the character â when it intended to emit a single quote character (why it does this, I have no clue).

Try setting the locale to the default C locale.

Upvotes: 1

Related Questions