Skip to content

Latest commit

 

History

History

COM-1308

COM 1308 หลักการออกแบบและการเขียนโปรแกรม

การพัฒนา

แนะนำ Windows Terminal เพื่อการทดสอบ
ต้องใช้ VS Code เพื่อพัฒนาหรือการสร้าง
ต้องใช้ Dev-C++ 5.11 TDM-GCC หรือ เวอร์ชันล่าสุด (คอมมหาลัย น่าจะมีอยู่แล้ว)

Warning

ต้องติดตั้งใน Path: C:\Program Files (x86)\Dev-Cpp เท่านั้น

ส่วนขยาย

การกำหนดค่า

Windows

📂.vscode
├─📄c_cpp_properties.json
├─📄launch.json
└─📄tasks.json

c_cpp_properties.json

{
	"configurations": [
		{
			"name": "windows-gcc-x64",
			"cStandard": "c99",
			"cppStandard": "gnu++11",
			"includePath": ["${default}", "C:/Program Files (x86)/Dev-Cpp/MinGW64/**"],
			"compilerPath": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/gcc.exe",
			"compilerArgs": ["-std=c11", "-std=gun11"]
		}
	],
	"version": 4
}

launch.json

{
	"configurations": [
		{
			"name": "Debug C/C++ Executable",
			"type": "cppvsdbg",
			"request": "launch",
			"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
			"preLaunchTask": "C/C++: gcc.exe build active file",
			"console": "externalTerminal",
			"stopAtEntry": false,
			"suppressMultipleSessionWarning": true,
			"cwd": "${fileDirname}"
		}
	],
	"version": "0.2.0"
}

tasks.json

{
	"tasks": [
		{
			"command": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/gcc.exe",
			"label": "C/C++: gcc.exe build active file",
			"type": "shell",
			"args": ["-fdiagnostics-color=always", "-O2", "-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe"],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"options": {
				"cwd": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin"
			},
			"presentation": {
				"clear": true,
				"echo": false,
				"focus": false,
				"panel": "shared",
				"reveal": "silent",
				"showReuseMessage": false
			},
			"problemMatcher": ["$gcc"]
		}
	],
	"version": "2.0.0"
}

เสร็จสิ้น

กด F5 ในไฟล์ที่ต้องการเพื่อทดสอบ
กด Shift + F5 เพื่อยกเลิก