Deepin 中的 sublime text 3 运行C++的配置??
Tofloor
poster avatar
jeson155
deepin
2018-12-19 19:53
Author
deepin 中的 sublime text 3 运行C++的配置??
在线等 !!有没有sublime text 3 ,配置成功能够编译c++运行,并能够在CMD窗口中输入数据的??
在线等 @@@
Reply Favorite View the author
All Replies
avatar
jeson155
deepin
2018-12-20 02:13
#1
看来 ,是没有人上来看的,我自己来吧。
以下是我的改动。好了!
My c++

/home/wen/.config/sublime-text-3/Packages/User

在自己的文件目录 下:我的是:/home/wen/

ctrl +h
会显示隐藏的文件 和目录,上面就 是文件的目录
在这建一个文档,也可在sublime 下建立,:就是  菜单下的  tool  --- buildsytem---new build system  
会在这儿自动建立新文件 ,
文件 内容 :

{
    "shell_cmd": "g++ '${file}' -o '${file_path}/${file_base_name}'",
    "file_regex": "^(..[^:]*)[0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",
   
    "variants":
    [
        {
            "name": "Build & Run",
            "shell_cmd": "x-terminal-emulator  -e bash -c \"g++ '${file}' -o '${file_path}/${file_base_name}' ; '${file_path}/${file_base_name}' ; read -p '\nPress ENTER or type command to continue...'\""
        },
   
        {
            "name": "Run Only",
            "shell_cmd": "x-terminal-emulator  -e bash -c \"'${file_path}/${file_base_name}' ; read -p '\nPress ENTER or type command to continue...'\""
        }
    ]
}

我这也是好不容易找到的,属于借鉴

在DEEPIN
下会编译运行C++的程序
运行时也能在CMD的命令窗口里输入数据,不过是c的能,比如CIN的不行/
亲测,编译:scanf 可以输入,CIN<<失败。

Reply View the author
avatar
一天
deepin
2018-12-20 04:24
#2
现在不搞程序了,不过VS CODE是不是好设置点,我记得就装个扩展,再改下配置路径就好了。
Reply View the author
avatar
jeson155
deepin
2018-12-20 17:18
#3
我是初级阶段中,刚开始学习C++。
Reply View the author