【发布时间】:2017-05-13 07:44:01
【问题描述】:
我正在尝试使用以下语句从不同的库构建可执行文件
g++ -fPIC -O -DUSING_PCH -D_REENTRANT -I"/app1/home1/quickfast/boost_1_61_0/include/boost-1_61" -I"/app1/home1/quickfast/boost_1_61_0/." -I"../../src" -I"../src/Examples" -I"/app1/home1/quickfast/boost_1_61_0/include" -L"." -L"/app1/home1/quickfast/boost_1_61_0/stage/lib" -L/app1/home1/quickfast/quickfast-master/lib -l"QuickFAST" -l"boost_thread-gcc44-mt-1_61" -l"boost_system-gcc44-mt-1_61" -l"boost_filesystem-gcc44-mt-1_61" -l"boost_unit_test_framework-gcc44-mt-1_61" -static -ldl -lpthread -o "../../bin/testSequences"
上面的编译语句包含很多库,有动态库(.so 文件)和静态库(.a 文件)。例如,库 boost_system-gcc44-mt-1_61 在系统中以 libboost_system-gcc44-mt-1_61.so 和 libboost_system-gcc44-mt-1_61.a 的形式存在。我想要的是在编译时只选择动态库(.so 文件)而忽略静态库。谁能指导一下。
【问题讨论】:
标签: linux compilation g++