can cppclean be ran in windows?
Question:
So this is probably a very newbie question (which I am) but looking for tools for C++ code I found cppclean, so I follow the instructions on the repository cppclean but when running cppclean from a cmd terminal I get cppclean is not recognized as an internal or external command
I guess I am missing some steps apart from doing pip install cppclean
do I need to compile it or anything like it? I have tried to run it from the cmd and the python terminal. Is it even possible to run cppclean in windows or is it just for unix systems? Sorry if the question is too obvious but I have very little python knowledge.
Answers:
You have to add the Python scripts path, e.g. C:UsersUSERAppDataLocalProgramsPythonPython37-32Scripts
, to your system environment Path
variable. (Replace USER
with your actual user name and Python37-32
with your actual Python version). It’s described here
I have just come across this issue also. With the help of aforementioned suggestions, I managed to run it successfully:
- Open cmd, type in
cd C:UsersUSERAppDataLocalProgramsPythonPython37-32Scripts
Make sure to replace USER with your username.
- Type in
python cppclean PATH --verbose
(–verbose is optional) (replace PATH with the path of your .cpp files)
After testing it a few times, even though it got rid of declared but undefined functions, it didn’t get rid of unused includes.
So this is probably a very newbie question (which I am) but looking for tools for C++ code I found cppclean, so I follow the instructions on the repository cppclean but when running cppclean from a cmd terminal I get cppclean is not recognized as an internal or external command
I guess I am missing some steps apart from doing pip install cppclean
do I need to compile it or anything like it? I have tried to run it from the cmd and the python terminal. Is it even possible to run cppclean in windows or is it just for unix systems? Sorry if the question is too obvious but I have very little python knowledge.
You have to add the Python scripts path, e.g. C:UsersUSERAppDataLocalProgramsPythonPython37-32Scripts
, to your system environment Path
variable. (Replace USER
with your actual user name and Python37-32
with your actual Python version). It’s described here
I have just come across this issue also. With the help of aforementioned suggestions, I managed to run it successfully:
- Open cmd, type in
cd C:UsersUSERAppDataLocalProgramsPythonPython37-32Scripts
Make sure to replace USER with your username. - Type in
python cppclean PATH --verbose
(–verbose is optional) (replace PATH with the path of your .cpp files)
After testing it a few times, even though it got rid of declared but undefined functions, it didn’t get rid of unused includes.