不管是 WINDOWS 还是 LINUX 都可以用 VS CODE + GCC.
俺大概摸索了半天就可以编译 HELLO WORLD。摸索了一两个星期左右就能编译或者参照例子自己写 WASAPI 的录音程序。
俺是半截入土的中老年, 比不上你们朝气蓬勃思维灵活的年轻人。因此, 俺认为很大的可能, 你们会比俺更快地上手 VS CODE。
忘记强调一点, VS CODE + GCC 都是免费的, 用户评价极高的工具。
老实说, 俺也是在自己的另一台电脑上注意到有这个玩法。还花了一个晚上阅读 VS CODE 的说明。时间就是这样浪费掉的。但是, 没找到任何有用的提示。今天终于在寻找 GCC 的编译开关时发现了这个诀窍。分享给大家。
"-fdiagnostics-color=always"
-fdiagnostics-color=always 俺菜鸟, 所以也用上这个 "-Wall", "-Wextra",
当然很可能许多人知道, 但俺是第一次了解。
当然, 很可能许多人知道, 但俺是第一次了解。
"-fdiagnostics-color=always" 俺菜鸟, 所以也用上这个 "-Wall", "-Wextra",
TASKS.JSON
{ "tasks": [ { "type": "cppbuild", "label": "C/C++: gcc build active file", "command": "/usr/lib64/ccache/gcc", "args": [ "-lm", "-lpthread", "-lasound", "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}", "`pkg-config", "--cflags", "gtk+-3.0`", "`pkg-config", "--libs", "gtk+-3.0`", "-fdiagnostics-color=always" ], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "new", "showReuseMessage": true, "clear": false } }, { "type": "shell", "label": "run", "command": "/usr/lib64/ccache/gcc", // "args": [ "-lm", "-lpthread", "-lasound", "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}", "`pkg-config", "--cflags", "gtk+-3.0`", "`pkg-config", "--libs", "gtk+-3.0`", "-fdiagnostics-color=always" // 彩色警告在这里弄 ], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "test", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "new", "showReuseMessage": true, "clear": false } } ], "version": "2.0.0" }
*** 备注: WINDOWS 下 GCC 也有这个效果
TASKS.JSON (GCC WINDOWS)
{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: gcc.exe build active file", "command": "C:\MinGW\bin\gcc.exe", "args": [ "-lm", "-g", "${file}", "-o", "${fileDirname}\${fileBasenameNoExtension}.exe", "-fdiagnostics-color=always" ], "options": { "cwd": "C:\MinGW\bin" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: C:\MinGW\bin\gcc.exe" }, { "type": "shell", "label": "C/C++: gcc.exe build active file", "command": "C:\MinGW\bin\gcc.exe", "args": [ "-lm", "-g", "${file}", "-o", "${fileDirname}\${fileBasenameNoExtension}.exe", "-fdiagnostics-color=always" ], "options": { "cwd": "C:\MinGW\bin" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "compiler: C:\MinGW\bin\gcc.exe" } ] }
LAUNCH.JSON (WINDOWS)
*** 备注: 可能有错误, 但是能正常跑 HELLO WORLD
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "MY TESTING LAUNCH", "type": "cppdbg", "request": "launch", "program": "${fileDirname}\${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "C:\MinGW\bin", "environment": [], "MIMode": "gdb", "miDebuggerPath": "C:\MinGW\bin\gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "C/C++: gcc.exe build active file" } ] }
c_cpp_properties.json (WINDOWS)
{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**", "C:\MinGW\include" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "windowsSdkVersion": "10.0.18362.0", "compilerPath": "C:\MinGW\bin\gcc.exe", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "windows-gcc-x86" } ], "version": 4 }
##########################################################################
##########################################################################
另一台 WINDOWS 电脑上的配置文件 (能跑 HELLO WORLD)
TASKS.JSON
{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: gcc.exe build active file", "command": "C:\msys64\mingw64\bin\gcc.exe", "args": [ "-lm", "-g", "${file}", "-o", "${fileDirname}\${fileBasenameNoExtension}.exe", //"`pkg-config", "--cflags", "gtk+-3.0`", "`pkg-config", "--libs", "gtk+-3.0`", //"$(pkg-config --cflags gtk+-3.0)", "-Wall", "-Wextra", "-fdiagnostics-color=always" ], "options": { "cwd": "C:\msys64\mingw64\bin" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: C:\msys64\mingw64\bin\gcc.exe" }, { "type": "shell", "label": "C/C++: gcc.exe build active file", "command": "C:\msys64\mingw64\bin\gcc.exe", "args": [ "-lm", "-g", "${file}", "-o", "${fileDirname}\${fileBasenameNoExtension}.exe", //"`pkg-config", "--cflags", "gtk+-3.0`", "`pkg-config", "--libs", "gtk+-3.0`", //"$(pkg-config --cflags gtk+-3.0)", "-Wall", "-Wextra", "-fdiagnostics-color=always" ], "options": { "cwd": "C:\msys64\mingw64\bin" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "compiler: C:\msys64\mingw64\bin\gcc.exe" } ] }
LAUNCH.JSON (WINDOWS)
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "MY TESTING LAUNCH", "type": "cppdbg", "request": "launch", "program": "${fileDirname}\${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "C:\msys64\mingw64\bin", "environment": [], "MIMode": "gdb", "miDebuggerPath": "C:\msys64\mingw64\bin\gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "C/C++: gcc.exe build active file" } ] }
c_cpp_properties.json (WINDOWS)
{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**", "C:\msys64\mingw64\include", "C:\msys64\mingw64\lib\glib-2.0\include", "C:\msys64\mingw64\include\gtk-3.0", "C:\msys64\mingw64\include\glib-2.0", "C:\msys64\mingw64\include\pango-1.0", "C:\msys64\mingw64\include\harfbuzz", "C:\msys64\mingw64\include\freetype2", "C:\msys64\mingw64\include\libpng16", "C:\msys64\mingw64\include\libpkgconf", "C:\msys64\mingw64\include\fribidi", "C:\msys64\mingw64\include\libxml2", "C:\msys64\mingw64\include\cairo", "C:\msys64\mingw64\include\pixman-1", "C:\msys64\mingw64\include\gdk-pixbuf-2.0", "C:\msys64\mingw64\include\gio-win32-2.0", "C:\msys64\mingw64\include\atk-1.0", "C:\msys64\mingw64\include\libgladeui-2.0" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "windowsSdkVersion": "10.0.18362.0", "compilerPath": "C:\msys64\mingw64\bin\gcc.exe", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "windows-gcc-x86" } ], "version": 4 }
不用谢。
附录:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
俺没啥文化, 初中毕业,大伙都知道。
俺不到一百万知友(760多K),才升10级。阅读总量没到一小步(8000万左右,不到一个亿的小目标)。长期关注俺的知友知道, 俺不是专业的。 俺也不是大佬。
俺是最业余的......笑话、神棍和论坛孤儿
随夫姓不局限于发达国家,但全世界都大差不差。
婚后随夫姓,确实是体现了一种从属关系。如果按今天的政治正确,尤其是按女权思想,简直不可救药。而实际上,把目光放在历史长河当中,能随夫姓简直相当于进了体制内,属于铁饭碗待遇的体现!
苏轼牛不牛?其最爱的小妾,也就是被谪至黄州[1]都没有卖掉[2]的王朝云[3],坟头上也只能写着王氏,而非苏王氏[4]。
另外,关于姓氏,咱中国还略好一些,像日本,姓氏取的那么随意,也实在是没有办法!毕竟天皇到今天还没有姓氏[5],而平民拥有姓氏也只是近150年的事情[6]。姓氏上由于太随意,留下了很多奇葩的存在,例如"一二三、我孙子、肛门、猪鼻、上床、浮気[7]、土肥"……
名字就更随意了,男娃就叫大郎、次郎、三郎,至于山本五十六[8],咱也不敢说,咱也不敢问;女娃就是花子、美子、优子、菜子……并不比我们的大柱、二牛、小凤、翠花更高雅……
欧洲也没好到哪去,别看有些人名字里带个"Von/de/Don"之类的很显洋贵,其实11世纪之前这些贵族连姓都没有[9]。至于平民,那就更好办了,要么领个教姓/名[10],要么干脆看情况起一个,比如Fisher(鱼夫),Smith(铁匠),Hunter(猎人),Johnson(约翰之子),苹果CEO cook祖上大概率是厨子……
但毫无疑问的是,家庭作为社会中最基本的利益共同体,能否成为正式的家庭成员当然是极重要的硬指标。
在长久的旧时代,宗族/家族出身是极重要的,这是不分国界的。于女性而言,几乎不可能独立生存,如果再得不到家族的实名认证,人生大都是悲惨的。如果说有所区别,大概也只是悲惨的程度和花样。
现在回归问题身本:为什么如今在很多发达国家同样以随夫姓为主流呢?
先说,我国是破了四旧[11],烧了不知多少本家/族谱,否则也不会出现争冠姓权这种事。
一方面是惯性使然。这可不只是习惯问题,更不是简单的一句"传统观念"就能解释的。这种惯性,更多的是一种力量,是利益集团的一个标致,其中并非只有男权,而是整个家族的权力征徽,更类似于一家大企业的名号,其庇护作用是显而易见的。
而平民阶层随夫姓的主要原因是效仿权贵阶层,除了自觉拿到了"皇帝的金锄头",再就是"话事人[12]"原则的体现,也就是每家每户,都要有个撑门面的最强者,而普遍上兼具暴力与理性的男性显然更适合这个位置。就普通家庭而言,其实这个位置并没有多爽,责权一体不是说着玩的!如果放在中国,这个位置就更难坐了,很多中国家庭中享有冠姓权的男性,责任与实权、收益并不成正比。
这里面还有个逻辑推导,既从妻子的角度出发“我随他姓是因为他很强,也比我强,如果反过来,他随我姓就说明我比他强,反推就是他比我弱,如果我还不如多数随夫姓的女子,那则说明我们一家子都还不如别人家最弱的那个,那就没法混了呀!”
所以,姓氏对于小家庭意义并不大,但对家庭某一成员的意义很大。且随夫姓并不见得就亏,反而很可能是赚的,无利不起早,这符合人性中的趋利特点。
那一定有人问“为什么现在很多女性/女权还要争冠姓权呢?”
答案就是:不是姓氏有问题,而是人品有问题!
以上。