linux下gcc编译c++程序连接问题

在当前目录下有lib、include两个文件夹

lib文件夹下有有动态库libmy.so

include文件加下有my.h文件

当前文件下有test.cpp文件,入口函数在这个文件里

test.cpp里面用到了libmy.so里面的函数

也用到了c++11的特性 还有 线程

下面就是我们编译这个应用程序的命令

生成文件test
# g++ test.cpp -I./include -L ./lib -std=c++11 -lmy --pthread o teset

猜你喜欢

转载自blog.csdn.net/qianpeng4/article/details/79563359