当前位置:网站首页>QT cmake pure C code calls the system console to input scanf and Chinese output garbled code

QT cmake pure C code calls the system console to input scanf and Chinese output garbled code

2022-06-26 01:05:00 NIWODIY

Qt Cmake pure C The code calls the system console to enter scanf And Chinese output garbled code
2020-11-20 15:57:19
System console output

When using the input function ,Qt Built in console .
Call the method of the system console , Click on the left side of the “ project ” Icon , The build and run interface appears , choice “ function ” Options , Check “ Run in terminal (Run in terminal)” that will do .
 Insert picture description here

Chinese output garbled code

stay CMakeLists.txt Add the following code to

#dubug -g  debugging  GBK  chinese 
set (CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -g -fexec-charset=GBK")

 Insert picture description here

原网站

版权声明
本文为[NIWODIY]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206252312322398.html