编译问题

1.

用 math库

错误信息:

/tmp/ccmJmMoE.o: In function `test':
test.c:(.text+0x19): undefined reference to `log10'
collect2: ld returned 1 exit status

gcc -Wall  main.o test.o  -lm -o test

-lm 要放到 .o 后面

 

 

 

2.

libssl

libssl.so: undefined reference to `BN_CTX_free'
libssl.so: undefined reference to `X509_free'

...

编译时加上 ssl 和 crypto 两个

-lssl -lcrypto 

posted on 2017-06-21 10:02  listenerln  阅读(344)  评论(0)    收藏  举报