Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with directory containing Chinese characters #61

Closed
anbangli opened this issue Dec 5, 2023 · 3 comments
Closed

Problems with directory containing Chinese characters #61

anbangli opened this issue Dec 5, 2023 · 3 comments

Comments

@anbangli
Copy link

anbangli commented Dec 5, 2023

I am an Chinese programmer, and I found that the current MinGW-w64 versions (11.2, 12.2, 13.2, released by niXman or winlibs) have two problems with directories which contain Chinese characters.

Normally, MinGW-w64 is installed in directory "C:\MinGW64". If my program "hello.cpp" saved in directory "C:\myprogs", then following compiling command will success:

C:\MinGW64\bin\g++.exe "C:\myprogs\hello.cpp" -o "C:\myprogs\hello.exe" -Wall -Wextra -pipe -I"C:\MinGW64\include" -I"C:\MinGW64\x86_64-w64-mingw32\include" -I"C:\MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include" -I"C:\MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include\c++" -L"C:\MinGW64\lib" -L"C:\MinGW64\x86_64-w64-mingw32\lib" -static-libstdc++ -static-libgcc

Problem 1: if the path of my programs contains Chinese characters, then compilation will fail.
For example, MinGW-w64 is installed in normal directory "C:\MinGW64", my program "hello.cpp" saved in directory "C:\我的程序",I typed the following compiling command::

C:\MinGW64\bin\g++.exe "C:\我的程序\hello.cpp" -o "C:\我的程序\hello.exe" -Wall -Wextra -pipe -I"C:\MinGW64\include" -I"C:\MinGW64\x86_64-w64-mingw32\include" -I"C:\MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include" -I"C:\MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include\c++" -L"C:\MinGW64\lib" -L"C:\MinGW64\x86_64-w64-mingw32\lib" -static-libstdc++ -static-libgcc

The compilation command will give message:
cc1plus.exe: fatal error: C:\鎕ello.cpp: No such file or directory
compilation terminated.

Apparently, path "C:\我的程序\hello.cpp" is not correctly processed, it was processed as "C:\鎕ello.cpp".

If I rename the program file "hello.cpp" to "测试hello.cpp", and typed the following compiling command:
C:\MinGW64\bin\g++.exe "C:\我的程序\测试hello.cpp" -o "C:\我的程序\测试hello.exe" -Wall -Wextra -pipe -I"C:\MinGW64\include" -I"C:\MinGW64\x86_64-w64-mingw32\include" -I"C:\MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include" -I"C:\MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include\c++" -L"C:\MinGW64\lib" -L"C:\MinGW64\x86_64-w64-mingw32\lib" -static-libstdc++ -static-libgcc

The compilation command will give message:
C:\骀礶llo.cpp: In function 'int main()':
C:\骀礶llo.cpp:7:36: error: expected ';' before 'return'
7 | cout << "Hello, World!" << endl
| ^
| ;
8 |
9 | return 0;

Apparently, path "C:\我的程序\测试hello.cpp" is not correctly processed, it was processed as "C:\骀礶llo.cpp".

Problem 2: If the installation directory of MinGW-w64 contains Chinese Characters, then compilation will fail.
For example, MinGW-w64 is installed in directory "C:\编译器MinGW64" which contains Chinese characters, one tried to compile program "C:\myprogs\hello.cpp" with the following command:

C:\编译器MinGW64\bin\g++.exe "C:\myprogs\hello.cpp" -o "C:\编译器hello.exe" -Wall -Wextra -pipe -I"C:\编译器MinGW64\include" -I"C:\编译器MinGW64\x86_64-w64-mingw32\include" -I"C:\编译器MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include" -I"C:\编译器MinGW64\lib\gcc\x86_64-w64-mingw32\13.2.0\include\c++" -L"C:\编译器MinGW64\lib" -L"C:\编译器MinGW64\x86_64-w64-mingw32\lib" -static-libstdc++ -static-libgcc

The compilation will fail, and the output message is:

C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o: No space left on device
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o: No space left on device
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lstdc++: No space left on device
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc: No space left on device
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh: No space left on device
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc: No space left on device
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh: No space left on device
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o: No space left on device
collect2.exe: error: ld returned 1 exit status

It seems that the Chinese characters "编译器" are ignored in some internal stage.

Please check the two problems. Thanks.

BTW, MinGW-w64 8.1.0 does not have such problems.

@niXman
Copy link
Owner

niXman commented Dec 6, 2023

hi,

looks like the same issue?: niXman/mingw-builds#649

@anbangli
Copy link
Author

anbangli commented Dec 7, 2023

"Problem 1" in this issue seems to be the same with "1st bug" in that issue.

But "Problem 2" seems not concerned in that issue.

@niXman
Copy link
Owner

niXman commented Dec 16, 2023

@anbangli it seems according to the answer (niXman/mingw-builds#649 (comment)) the question is solved?

if so - please close the issue.

best!

@anbangli anbangli closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants