今天博主在编写数据结构的程序时,发现不能编译,出现cannot compile the file***:no compile tool is associated with the file extension.问题。然后尝试直接选择红色感叹号运行时出现cannot execute program问题。然后博主尝试了很多遍都不OK,百度解决办法。
1、对于cannot execute program,博主百度发现解决办法是Project-》Setting-》Debug选择Executable for debug session选项,选择编译连接后正确的可执行文件的路径就可以了。
来源:https://blog.youkuaiyun.com/lxh1230119/article/details/8067096
但是博主发现自己的路径没问题。
2、所以继续搜索前面一个问题:cannot compile the file***:no compile tool is associated with the file extension.问题
解决办法是:关闭当前文件,重新打开一个新的CPP文件即可。
然后就可以编译连接且成功运行程序了。
总结原因: