link disabled in settings.json #21
RoyChenCAD
started this conversation in
Cpp in VSCode on macOS
Replies: 2 comments
-
你最后说的原因是对的,因为你在 ./10codes/.vscode/settings.json 中添加的 |
Beta Was this translation helpful? Give feedback.
0 replies
-
原来如此,难怪我在替换并配置了新的文件夹以后出现该问题,没有注意到workspace所对应的默认路径范围(当然之前也没有用过编译器的link功能就是了)。vscode永远在以一种意想不到的方式串联我这几个月来学到的知识。 感谢up主的回复与解答!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
问题描述
"cpp": "g++ $fullFileName stock01.cpp -o $dir"$fileNameWithoutExt"".out" -W -Wall -O2 -std=c++17 && $dir"$fileNameWithoutExt"".out"",
使用该命令行在settings.json中link stock01.cpp文件,但是运行usestock01.cpp文件仍然出现link 错误。这是文件代码

这是TERMINAL报错
a111@111deMacBook-Pro Cpp_Primer_Plus_6_Edition % g++ "/Users/a111/Desktop/Cpp_Primer_Plus
_6_Edition/10codes/usestock01.cpp" -o "/Users/a111/Desktop/Cpp_Primer_Plus_6_Edition/10cod
es/""usestock01"".out" -W -Wall -O2 -std=c++17 && "/Users/a111/Desktop/Cpp_Primer_Plus_6_E
dition/10codes/""usestock01"".out"
ld: Undefined symbols:
Stock::buy(long, double), referenced from:
_main in usestock01-b70e1a.o
Stock::sell(long, double), referenced from:
_main in usestock01-b70e1a.o
Stock::show(), referenced from:
_main in usestock01-b70e1a.o
_main in usestock01-b70e1a.o
_main in usestock01-b70e1a.o
Stock::acquire(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, long, double), referenced from:
_main in usestock01-b70e1a.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
是否是因为执行了全局的.vscode settings.json的文件,而非该/10codes/.vscode setting.json的文件,请问我如何调试
Beta Was this translation helpful? Give feedback.
All reactions