当.pro文件包含相同的内容的时候,比如同一个.cpp,.h,就会报错: Cannot add commands to previously defined target解决方案:在pro文件中找到,并删除重复的,就可以了。