C++ 链接静态库的未解析符号

C++ 链接静态库的未解析符号,c++,linker,poco-libraries,C++,Linker,Poco Libraries,通过链接静态和动态库,我得到了一些未定义的引用 我的目标是获得一个具有poco和uiohook库静态链接的可执行文件。为了指定静态链接,我提供了指向库的直接路径,有些路径是path/libName.a 以下命令: /home/lrleon/LLVM-3.7/bin/clang -o collector -g -O2 -fno-strict-aliasing \ collector.o common-vars.o collector-events.o listeners.o \ active_wi

通过链接静态和动态库,我得到了一些未定义的引用

我的目标是获得一个具有poco和uiohook库静态链接的可执行文件。为了指定静态链接,我提供了指向库的直接路径,有些路径是
path/libName.a

以下命令:

/home/lrleon/LLVM-3.7/bin/clang -o collector -g -O2 -fno-strict-aliasing \
collector.o common-vars.o collector-events.o listeners.o \
active_window.o ../lib/libperfq-common.a \
/home/lrleon/aleph-w/libAleph.a /home/lrleon/poco/lib/libPocoNet.a \
/home/lrleon/poco/lib/libPocoFoundation.a /home/lrleon/uiohook/lib/libuiohook.a \
-lstdc++ -lX11 -lcairo -lgsl -lgslcblas -lpthread -lc 
给出了以下错误:

/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:function Poco::DateTime::dayOfWeek() const: error: undefined reference to 'floor'
/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:function Poco::DateTime::toJulianDay(int, int, int, int, int, int, int, int): error: undefined reference to 'floor'
/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:function Poco::DateTime::toJulianDay(int, int, int, int, int, int, int, int): error: undefined reference to 'floor'
/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:function Poco::DateTime::toJulianDay(int, int, int, int, int, int, int, int): error: undefined reference to 'floor'
/home/lrleon/poco/lib/libPocoFoundation.a(NumericString.o):NumericString.cpp:function double_conversion::PowersOfTenCache::GetCachedPowerForBinaryExponentRange(int, int, double_conversion::DiyFp*, int*): error: undefined reference to 'ceil'
/home/lrleon/poco/lib/libPocoFoundation.a(NumericString.o):NumericString.cpp:function double_conversion::BignumDtoa(double, double_conversion::BignumDtoaMode, int, double_conversion::Vector<char>, int*, int*): error: undefined reference to 'ceil'
/home/lrleon/poco/lib/libPocoFoundation.a(NumericString.o):NumericString.cpp:function Poco::floatToStr(std::string&, float, int, int, char, char): error: undefined reference to 'floorf'
src/x11/input_hook.c:673: error: undefined reference to 'XRecordFreeData'
src/x11/input_hook.c:722: error: undefined reference to 'XRecordQueryVersion'
src/x11/input_hook.c:733: error: undefined reference to 'XRecordAllocRange'
src/x11/input_hook.c:745: error: undefined reference to 'XRecordCreateContext'
src/x11/input_hook.c:792: error: undefined reference to 'XRecordEnableContext'
src/x11/input_hook.c:812: error: undefined reference to 'XRecordFreeContext'
src/x11/input_hook.c:883: error: undefined reference to 'XRecordGetContext'
src/x11/input_hook.c:885: error: undefined reference to 'XRecordDisableContext'
src/x11/system_properties.c:134: error: undefined reference to 'XineramaIsActive'
src/x11/system_properties.c:136: error: undefined reference to 'XineramaQueryScreens'
src/x11/system_properties.c:396: error: undefined reference to 'XtGetMultiClickTime'
src/x11/system_properties.c:480: error: undefined reference to 'XtToolkitInitialize'
src/x11/system_properties.c:481: error: undefined reference to 'XtCreateApplicationContext'
src/x11/system_properties.c:485: error: undefined reference to 'XtOpenDisplay'
src/x11/system_properties.c:502: error: undefined reference to 'XtCloseDisplay'
src/x11/system_properties.c:503: error: undefined reference to 'XtDestroyApplicationContext'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:函数poco::DateTime::dayOfWeek()常量:错误:未定义对“floor”的引用
/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:函数poco::DateTime::toJulianDay(int,int,int,int,int,int,int,int):错误:对“floor”的引用未定义
/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:函数poco::DateTime::toJulianDay(int,int,int,int,int,int,int,int):错误:对“floor”的引用未定义
/home/lrleon/poco/lib/libPocoFoundation.a(DateTime.o):DateTime.cpp:函数poco::DateTime::toJulianDay(int,int,int,int,int,int,int,int):错误:对“floor”的引用未定义
/home/lrleon/poco/lib/libPocoFoundation.a(NumericString.o):NumericString.cpp:函数双精度转换::PowersOfTenCache::GetCachedPowerForBinaryExponentRange(int,int,double\u转换::DiyFp*,int*):错误:对“ceil”的引用未定义
/home/lrleon/poco/lib/libPocoFoundation.a(NumericString.o):NumericString.cpp:函数double\u conversion::BignumDtoa(double,double\u conversion::BignumDtoaMode,int,double\u conversion::Vector,int*,int*):错误:对“ceil”的引用未定义
/home/lrleon/poco/lib/libPocoFoundation.a(NumericString.o):NumericString.cpp:函数poco::floatostr(std::string&,float,int,int,int,char,char):错误:对“floorf”的引用未定义
src/x11/input_hook.c:673:错误:未定义对“XRecordFreeData”的引用
src/x11/input_hook.c:722:错误:未定义对“XRecordQueryVersion”的引用
src/x11/input_hook.c:733:错误:未定义对“XRecordAllocRange”的引用
src/x11/input_hook.c:745:错误:未定义对“XRecordCreateContext”的引用
src/x11/input_hook.c:792:错误:未定义对“XRecordEnableContext”的引用
src/x11/input_hook.c:812:错误:未定义对“XRecordFreeContext”的引用
src/x11/input_hook.c:883:错误:未定义对“XRecordGetContext”的引用
src/x11/input_hook.c:885:错误:未定义对“XRecordDisableContext”的引用
src/x11/system_properties.c:134:错误:未定义对“XineramaIsActive”的引用
src/x11/system_properties.c:136:错误:未定义对“XineramaQueryScreens”的引用
src/x11/system_properties.c:396:错误:未定义对“XtGetMultiClickTime”的引用
src/x11/system_properties.c:480:错误:未定义对“XtToolkitInitialize”的引用
src/x11/system_properties.c:481:错误:未定义对“XtCreateApplicationContext”的引用
src/x11/system_properties.c:485:错误:未定义对“XtOpenDisplay”的引用
src/x11/system_properties.c:502:错误:未定义对“XtCloseDisplay”的引用
src/x11/system_properties.c:503:错误:未定义对“XtDestroyApplicationContext”的引用
叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用)
我不明白为什么没有找到一些符号。例如,
ceil
floor
由poco库引用,但这些符号将属于c标准库。据我所知,这些符号应该是可解析的,因为c库就在末尾链接;那是在poco图书馆之后。类似于对X11符号的引用,我相信这些符号是用libuiohook引用的,后面给出了链接顺序-lX11


知道我做错了什么吗?提前感谢

floor和ceil函数是在数学库中定义的,我看不到您使用
-lm
标志链接libm