Skip to content

[CPP] 如何合适的调试debug? #301

Answered by j178
JigaoLuo asked this question in Q&A
Discussion options

You must be logged in to vote

可以设置一下环境变量 DEBUG=1, 然后运行 leetgo test last -L 可以看到这样的输出:

2024/05/25 01:25:28 INFO building cmd="E:\Scoop\apps\gcc\current\bin\g++.exe -O2 -std=c++17 -I D:\Projects\goland\leetgo\out\cpp -o C:\Users\jo\AppData\Local\Temp\leetgo\two-sum-cpp.exec D:\Projects\goland\leetgo\out\cpp\0001.two-sum\solution.cpp"

这个就是 leetgo 编译 cpp 时候的命令,二进制是放在 C:\Users\jo\AppData\Local\Temp\leetgo\two-sum-cpp.exec 下的,你也可以自己用 gcc/clang 编译,输出到任意指定的位置。

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by JigaoLuo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants