νμΌμ λ§λ€μμ΅λλ€
D:\Program\USACO\[C2, S3.2] Magic Square.cpp
νμ§λ§ μ»΄νμΌ ν λ
λͺ κ°μ§ μ€λ₯κ° λ°μνμ΅λλ€.
[Running] cd "d:\Program\USACO\" && g++ [C2, S3.2] Magic Square.cpp -o [C2, S3.2] Magic Square && "d:\Program\USACO\"[C2, S3.2] Magic Square
g++: error: [C2,: No such file or directory
g++: error: S3.2]: No such file or directory
g++: error: Magic: No such file or directory
g++: error: Square.cpp: No such file or directory
g++: error: S3.2]: No such file or directory
g++: error: Magic: No such file or directory
g++: error: Square: No such file or directory
g++: fatal error: no input files
compilation terminated.
μ΄μ체μ : Win7 SP1
VSCode : 1.19.3
λ¬λ : 0.8.7 5beeedfa674b330537448162dfe9c2330c7eda50
κ°μ λ¬Έμ μ
λλ€.
λ€μκ³Ό κ°μ΄ ꡬμ±μ μμ ν ν :
"code-runner.executorMap": {
"cpp": "cd $ dir && g ++ \"$ fileName \ "-o \"$ fileNameWithoutExt \ "&& $ dir $ fileNameWithoutExt"ο½
μ²μ λ λͺ λ Ήμ μ±κ³΅μ μΌλ‘ μ€νν μ μμ§λ§ λ§μ§λ§ λͺ λ Ή ($ dir $ fileNameWithoutExt)μμλ μλνμ§ μμ΅λλ€.
λ€μμ μΆλ ₯μ
λλ€.
@Michany $dir$fileNameWithoutExt
λ₯Ό $fileNameWithoutExt
λ³κ²½ν΄λ³΄μΈμ.
@ hanghang0702 λ―Έμ ν΄μ λ¦κ² @Michany λΉμ μ΄ μ΄μ€μΌμ΄ν λ¬Έμλ₯Ό μμ΄ λ²λ¦°κ±°μΌ, κ·Έκ²μ μ€ν νμΌμ΄ μ€ν ./"dir"filenameμ * nixμμ μ€ν¬λ¦½νΈ κΈ°λ° μμ€ν μμ λ¬Έμ κ°λμ§ μμ΅λλ€ @formulahendry
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac \"$fileName\" && java \"./$fileNameWithoutExt\"",
"c": "cd $dir && gcc \"$fileName\" -o \"$fileNameWithoutExt\" && \"./$fileNameWithoutExt\"",
"cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt\" && \"./$fileNameWithoutExt\"",
"objective-c": "cd $dir && gcc -framework Cocoa \"$fileName\" -o \"$fileNameWithoutExt\" && \"./$fileNameWithoutExt\"",}
λλ Windows μ¬μ©μκ° μλλ©° Windowsμμ μλνλμ§ νμ€νμ§ μμ΅λλ€ (μΌλΆ μ΄μ€μΌμ΄ν λ¬Έμ λλ μ΄μ μ μ¬ν κ²μ μ‘°μ / λ³κ²½ν΄μΌ ν κ²μ
λλ€).
λλ κ·Έλ€μ΄ λ€κ°μ€λ λ²μ μμ κ·Έκ²μ νΈμ§νκ³ κ³ μΉκΈ°λ₯Ό μ λ§λ‘ λ°λλλ€.
μ¬κΈ°μλ κ°μ λ¬Έμ κ° μμ΅λλ€.
bash ν°λ―Έλμμ C μ½λλ₯Ό μ€νν λ. λλ μ΄κ²μ μ»λλ€ :
bash : cd : d : \ VscodeProjectC \ demo "&& gcc file1.c -o file1 && _d : VscodeProjectCdemo"file1_ : ν΄λΉ νμΌ λλ λλ ν 리 μμ
λΆλͺ
ν λ§μ§λ§ λͺ
λ Ήμ μ¬λ°λ₯΄κ² μΈμλμ§ μμ΅λλ€. κ·Έκ²μ κ³ μΉλ λ°©λ²?
μλ νμΈμ!
Mac OS Xμμλ κ°μ λ¬Έμ κ° μμ΅λλ€.μ΄ λ²κ·Έμ λν ν΄κ²°μ±
μ΄ μμ΅λκΉ?
Example 1.cppμ μ΄λ¦μ Example1.cpp λλ Example_1.cppλ‘ λ°κΎΈλ©΄ μ μμ μΌλ‘ μλν©λλ€.
κ°μ¬ν©λλ€!
Windowsλ₯Ό μ¬μ©νλ κ²½μ° λ€μκ³Ό κ°μ΄ μ€μ μ κ΅¬μ± ν΄λ³΄μμμ€.
"code-runner.executorMap": {
"cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt.exe\" && & \"$dir$fileNameWithoutExt.exe\""
}
μΆκ° '&'
λ¬Έμμμ£Όμνμμμ€.
Unix κΈ°λ° μμ€ν μ μ¬μ©νλ κ²½μ° λ€μμ μλνμμμ€ (ν μ€νΈνμ§λ μμμ§λ§ μλ ν κ²μ΄λΌκ³ μκ°ν©λλ€).
"code-runner.executorMap": {
"cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt\" && \"$dir$fileNameWithoutExt\""
}
μλ νμΈμ, μ λ κ°μ λ¬Έμ κ° μμ΅λλ€. Windowsλ₯Ό μ¬μ©νκ³ μμΌλ©° κ°λ¨ν C ++ νλ‘κ·Έλ¨μ μ€ννλ €κ³ ν©λλ€. κ²½λ‘ λ νμΌ μ΄λ¦μ κ³΅λ°±μ΄ μμ΅λλ€.
[Running] cd "c:\Users\Guillaume\Desktop\" && g++ test.cpp -o test && "c:\Users\Guillaume\Desktop\"test
g++: error: test.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.
λͺ λ Ήμ κ·Έλλ‘ λ³΅μ¬νκ³ cmd.exeμ λΆμ¬ λ£μΌλ©΄ λ¬Έμ μμ΄ μλν©λλ€.
λ€λ₯Έ μ¬λμ΄ μ μνλλ‘ λ³κ²½νμ§λ§ μ무κ²λ μλνμ§ μμμ΅λλ€.
νΈμ§ : ν΄κ²°λμμ΅λλ€! λ€λ₯Έ μ¬λλ€μκ² λμμ΄ λ μμλ λ°©λ²μ λ€μκ³Ό κ°μ΅λλ€.
"code-runner.executorMap": {
"cpp": "cd $dir && g++ $dirWithoutTrailingSlash\\$fileName -o $fileNameWithoutExt && $fileNameWithoutExt"
}
μλ
νμλκΉ...
μ΄λμμλ code-runner, executorMapμ μ°Ύμ μ μμ΅λλ€.
μ΄ μ½λλ₯Ό μ νν μ΄λμ λΆμ¬ λ£μκΉμ?
settings.jsonμμ? ... κ·Έκ³³μ μ½λλ₯Ό λΆμ¬ λ£λ κ²μ΄ μλνμ§ μμμ΅λλ€ ... :(
μλ νμλκΉ...
μ΄λμμλ code-runner, executorMapμ μ°Ύμ μ μμ΅λλ€.
μ΄ μ½λλ₯Ό μ νν μ΄λμ λΆμ¬ λ£μκΉμ?
settings.jsonμμ? ... κ·Έκ³³μ μ½λλ₯Ό λΆμ¬ λ£λ κ²μ΄ μλνμ§ μμμ΅λλ€ ... :(
μ, settings.jsonμμ.
λ§μΉ¨λ΄ λμ μ΄ λͺ λ Ήμ μ¬μ©νμ΅λλ€.
"cpp": "cd $dir ; g++ $fileName -o $fileNameWithoutExt.exe ; .\\$fileNameWithoutExt.exe"
λ€μμ λ΄ settings.jsonμ μΆμΆμ λλ€.
"c-cpp-compile-run.cpp-compiler": "C:\\MinGW\\bin",
"window.zoomLevel": -1,
"code-runner.executorMap": {
//"javascript": "node",
//"php": "C:\\php\\php.exe",
//"python": "python",
//"perl": "perl",
//"ruby": "C:\\Ruby23-x64\\bin\\ruby.exe",
//"go": "go run",
//"html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
//"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
//"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir ; g++ $fileName -o $fileNameWithoutExt.exe ; .\\$fileNameWithoutExt.exe"
},
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.cStandard": "c11",
λλ λνμ΄ λ¬Έμ κ° μλ€κ³ μκ°ν©λλ€. κ·Έκ²μ ν΄κ²°ν κ³νμ΄ μμ΅λκΉ? λ΄ κ²°κ³Όλ λ€μκ³Ό κ°μ΅λλ€.
$ cd "c:\Users\Jacob Armiger\Documents\cpp_files\" && g++ hello.cpp -o hello && "c:\Users\Jacob Armiger\Documents\cpp_files\"hello
bash: cd: too many arguments
μλ νμΈμ, λ§μ μκ°μ λ Έλ ₯ν ν ν΄κ²°μ± μ μ°Ύμμ΅λλ€. μ΄κ²μ΄ λ€λ₯Έ μ¬λλ€μκ² λμμ΄λκΈ°λ₯Ό λ°λλλ€.
"cpp": "cd $ dir && g ++ \"$ fileName \ "-o \"$ fileNameWithoutExt \ "&&. \\"$ fileNameWithoutExt \ "",
μλ νμΈμ, λ§μ μκ°μ λ Έλ ₯ν ν ν΄κ²°μ± μ μ°Ύμμ΅λλ€. μ΄κ²μ΄ λ€λ₯Έ μ¬λλ€μκ² λμμ΄λκΈ°λ₯Ό λ°λλλ€.
"cpp": "cd $ dir && g ++"$ fileName "-o"$ fileNameWithoutExt "&&. \"$ fileNameWithoutExt "",
μ΄κ²μ μΆκ° ν μμΉ ?? .vscodeμ IN settings.json νμΌ ?? μλλ©΄ λ€λ₯Έ κ³³?
-> μ, vscodeμ settings.json (μ νν μ€νμ 맡μ μμ)μ 볡μ¬ν΄μΌν©λλ€. μ¬μ§μ 첨λΆνκ² μ΅λλ€.
Windows Guys!
μ΄ κ³Όκ±°λ₯Ό settings.json νμΌμ 볡μ¬νμμμ€.
λλ λ§μ μ°κ΅¬λ₯Όνκ³ μ΄κ²μ νμ€ν ν¨κ³Όκ°μμ κ²μ λλ€
"code-runner.executorMap": {
"cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt\" && \"$fileNameWithoutExt\""
},
Windowsλ₯Ό μ¬μ©νλ κ²½μ° λ€μκ³Ό κ°μ΄ μ€μ μ κ΅¬μ± ν΄λ³΄μμμ€.
"code-runner.executorMap": { "cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt.exe\" && & \"$dir$fileNameWithoutExt.exe\"" }
μΆκ°
'&'
λ¬Έμμμ£Όμνμμμ€.Unix κΈ°λ° μμ€ν μ μ¬μ©νλ κ²½μ° λ€μμ μλνμμμ€ (ν μ€νΈνμ§λ μμμ§λ§ μλ ν κ²μ΄λΌκ³ μκ°ν©λλ€).
"code-runner.executorMap": { "cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt\" && \"$dir$fileNameWithoutExt\"" }
μ΄κ²μ λλ₯Ό μν΄ μΌνμ΅λλ€. μ΄μ c cpp λ° java νμΌμ μ»΄νμΌνκ³ μ€νν μ μμ΅λλ€ ( '&'λ μλ°μμ νμνμ§ μμ΅λλ€.
Windowsλ₯Ό μ¬μ©νλ κ²½μ° λ€μκ³Ό κ°μ΄ μ€μ μ κ΅¬μ± ν΄λ³΄μμμ€.
"code-runner.executorMap": { "cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt.exe\" && & \"$dir$fileNameWithoutExt.exe\"" }
μΆκ°
'&'
λ¬Έμμμ£Όμνμμμ€.Unix κΈ°λ° μμ€ν μ μ¬μ©νλ κ²½μ° λ€μμ μλνμμμ€ (ν μ€νΈνμ§λ μμμ§λ§ μλ ν κ²μ΄λΌκ³ μκ°ν©λλ€).
"code-runner.executorMap": { "cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt\" && \"$dir$fileNameWithoutExt\"" }
μ΄ μ루μ μ΄ μλν©λλ€ !! λ§μ§λ§μΌλ‘ λ΄ C νλ‘κ·Έλ¨μ μ»΄νμΌνκ³ μ€νν μ μμ΅λλ€. κ°μ¬!
μ λ§ λμμ΄λμμ΅λλ€. κ°μ¬ν©λλ€!
Windowsλ₯Ό μ¬μ© μ€μ
λλ€.
μ λ° λμμ£ΌμΈμ !!! π κ°μ μ€λ₯κ° λ°μν©λλ€.
{
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"python.pythonPath": "C:\\Users\\ABHISHEK\\anaconda3\\python.exe",
"java.home": "C:\\Program Files\\Java\\jdk-12.0.2",
"java.help.firstView": "gettingStarted",
"workbench.iconTheme": "vscode-icons",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.semanticHighlighting.enabled": true,
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"python.jediEnabled": false,
"python.dataScience.sendSelectionToInteractiveWindow": true,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"python.languageServer": "Microsoft",
"files.associations": {
"*.cpp": "cpp"
},
"C_Cpp.updateChannel": "Insiders",
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt.exe\" && & \"$dir$fileNameWithoutExt.exe\"",
"objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir $fileNameWithoutExt",
"php": "php",
"python": "python -u",
"perl": "perl",
"perl6": "perl6",
"ruby": "ruby",
"go": "go run",
"lua": "lua",
"groovy": "groovy",
"powershell": "powershell -ExecutionPolicy ByPass -File",
"bat": "cmd /c",
"shellscript": "bash",
"fsharp": "fsi",
"csharp": "scriptcs",
"vbscript": "cscript //Nologo",
"typescript": "ts-node",
"coffeescript": "coffee",
"scala": "scala",
"swift": "swift",
"julia": "julia",
"crystal": "crystal",
"ocaml": "ocaml",
"r": "Rscript",
"applescript": "osascript",
"clojure": "lein exec",
"haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
"rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
"racket": "racket",
"scheme": "csi -script",
"ahk": "autohotkey",
"autoit": "autoit3",
"dart": "dart",
"pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
"d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
"haskell": "runhaskell",
"nim": "nim compile --verbosity:0 --hints:off --run",
"lisp": "sbcl --script",
"kit": "kitc --run",
"v": "v run",
"sass": "sass --style expanded",
"scss": "scss --style expanded",
"less": "cd $dir && lessc $fileName $fileNameWithoutExt.css"
},
"window.zoomLevel": 0,
"files.autoSave": "onFocusChange",
"diffEditor.ignoreTrimWhitespace": false,
"[cpp]": {
"editor.wordBasedSuggestions": false,
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true
},
"code-runner.runInTerminal": true,
"code-runner.saveAllFilesBeforeRun": true,
"settingsSync.ignoredSettings": [
"-java.configuration.runtimes"
],
"liveServer.settings.donotShowInfoMsg": true,
"java.refactor.renameFromFileExplorer": "autoApply",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"eslint.codeAction.showDocumentation": {
"enable": true
},
"git.autofetch": true,
"vsicons.dontShowNewVersionMessage": true,
}
μ΄κ²μ μ¬μ ν ββλκ°μ μ€λ₯κ° λ°μν©λλ€.
λ΄ νκ²½ λ³μ :
κ·Έλ¦¬κ³ λ§μ½ λκ΅°κ°κ° λ΄ νμΌ λ±μ λν΄ μλ¬Έμ κ°μ§κ³ μλ€λ©΄ ...
@formulahendry @HeyJayant @ Kaushikμ΄ - 리μ
@ tripathi-abhishek μ¬μ©
"bash : cd : too many arguments"μ κ°μ bash μ€λ₯λ‘ λ¬Έμ κ° λ°μν κ²½μ°
ν΄κ²° λ°©λ² :-
μ½λ μ€νκΈ°μ λν Visual Studio μ½λ μ€μ μΌλ‘ μ΄λνκ³ code-runner.executorMapμ cpp ν€ κ° μμ λ€μμΌλ‘ λ°κΏλλ€.
"code-runner.executorMap": {
"cpp": "g ++ $ fileName -o $ fileNameWithoutExt.exe && './$fileNameWithoutExt.exe'"
}
S creenshot :-
cpp ν€ κ° μμ λ€μκ³Ό κ°μ΄ "code-runner.executorMap"μμ μλ μΈκΈ λ μ½λλ‘ λ°κΏλλ€ .
@ VipulKhandelwal1999 κ°μ¬ν©λλ€!
@ushakhanal μ λ΄ μ견μ μ½μμ΅λλ€. "λ무 λ§μ μΈμ"μ€λ₯κ° λ°μνμ λ μ΄λ»κ²ν΄μΌνλμ§ μ΄λ―Έ μ€λͺ νμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
Windowsλ₯Ό μ¬μ©νλ κ²½μ° λ€μκ³Ό κ°μ΄ μ€μ μ κ΅¬μ± ν΄λ³΄μμμ€.
μΆκ°
'&'
λ¬Έμμμ£Όμνμμμ€.Unix κΈ°λ° μμ€ν μ μ¬μ©νλ κ²½μ° λ€μμ μλνμμμ€ (ν μ€νΈνμ§λ μμμ§λ§ μλ ν κ²μ΄λΌκ³ μκ°ν©λλ€).