Questions tagged «undefined-reference»


14
libpthread.so.0:添加符号时出错:命令行缺少DSO
编译openvswitch-1.5.0时,遇到以下编译错误: gcc -Wstrict-prototypes -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement -Wformat-security -Wswitch-enum -Wunused-parameter -Wstrict-aliasing -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -Wno-override-init -g -O2 -export-dynamic ***-lpthread*** -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.a /home/jyyoo/src/dpdk/build/lib/librte_eal.a /home/jyyoo/src/dpdk/build/lib/libethdev.a /home/jyyoo/src/dpdk/build/lib/librte_cmdline.a /home/jyyoo/src/dpdk/build/lib/librte_hash.a /home/jyyoo/src/dpdk/build/lib/librte_lpm.a /home/jyyoo/src/dpdk/build/lib/librte_mbuf.a /home/jyyoo/src/dpdk/build/lib/librte_ring.a /home/jyyoo/src/dpdk/build/lib/librte_mempool.a /home/jyyoo/src/dpdk/build/lib/librte_malloc.a -lrt -lm /usr/bin/ld: /home/jyyoo/src/dpdk/build/lib/librte_eal.a(eal.o): undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing …

6
未定义对“ pow”和“ floor”的引用
我试图用C语言制作一个简单的斐波那契计算器,但是编译时gcc告诉我我缺少pow和floor函数。怎么了? 码: #include <stdio.h> #include <math.h> int fibo(int n); int main() { printf("Fib(4) = %d", fibo(4)); return 0; } int fibo(int n) { double phi = 1.61803399; return (int)(floor((float)(pow(phi, n) / sqrt(5)) + .5f)); } 输出: gab@testvm:~/work/c/fibo$ gcc fib.c -o fibo /tmp/ccNSjm4q.o: In function `fibo': fib.c:(.text+0x4a): undefined reference to `pow' …

4
未定义对静态成员的引用
我正在使用交叉编译器。我的代码是: class WindowsTimer{ public: WindowsTimer(){ _frequency.QuadPart = 0ull; } private: static LARGE_INTEGER _frequency; }; 我收到以下错误: 未定义对WindowsTimer :: _ frequency的引用 我也尝试将其更改为 LARGE_INTEGER _frequency.QuadPart = 0ull; 要么 static LARGE_INTEGER _frequency.QuadPart = 0ull; 但我仍然遇到错误。 谁知道为什么?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.