添加头文价
1.在项目文件夹下新建include文件夹
2.在qt下新建头文件
3.指定头文件位置
4.cmakelist.txt添加
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
5.编译后include添加到项目中
添加源文件
1.项目目录下新建src文件夹
2.在qt新建源文件
3.指定源文件位置
4.修改cmakelist.txt
add_library()
target_link_libraries()
add_library(lib_a SHARED
src/linklist.cpp
)
add_executable(${PROJECT_NAME} "main.cpp")
target_link_libraries(${PROJECT_NAME} lib_a)
5.编译后自动添加