[C++] error stray in program

在編譯 C++ 檔案時,compile 出現 error 如下:

../new:9: error: stray ‘\200’ in program
../new:9: error: stray ‘\237’ in program
../new:9: error: stray ‘\346’ in program
../new:9: error: stray ‘\265’ in program

主要原因是在程式碼裡,可能包含 unicode 的字元,而程式碼預設是用 en(ascii) 編譯。

或是可以把設定改成以下:
env LANG=en_US.UTF-8
即可。

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s