直接在xx.prj文件中添加 include(路径) 如include(src/qextserialport.pri) 特别值得注意的是路径一定要对,而且要在main的前面(毕竟是预编译用的肯定要在main之前)。