当前位置: 技术问答>linux和unix
用gcc编译一个小程序,怎么不能联结成可执行文件?
来源: 互联网 发布时间:2015-09-24
本文导语: #make -f Makefile /usr/local/bin/gcc -O2 -fomit-frame-pointer -W -Wall -I/usr/local/ssl/include -L/usr/local/ssl/lib -c getX509info.c getX509info.c: In function `main': getX509info.c:32: warning: implicit declaration of function `load_cert' getX509info.c:32: warn...
#make -f Makefile
/usr/local/bin/gcc -O2 -fomit-frame-pointer -W -Wall -I/usr/local/ssl/include -L/usr/local/ssl/lib -c getX509info.c
getX509info.c: In function `main':
getX509info.c:32: warning: implicit declaration of function `load_cert'
getX509info.c:32: warning: assignment makes pointer from integer without a cast
getX509info.c:37: warning: too few arguments for format
getX509info.c:40: warning: implicit declaration of function `Parse_SerialNumber'
getX509info.c:62: warning: implicit declaration of function `Parse_Time'
getX509info.c:29: warning: unused variable `bp'
getX509info.c: At top level:
getX509info.c:78: warning: type mismatch with previous implicit declaration
getX509info.c:32: warning: previous implicit declaration of `load_cert'
getX509info.c:78: warning: `load_cert' was previously implicitly declared to return `int'
/usr/local/bin/gcc -O2 -fomit-frame-pointer -W -Wall -I/usr/local/ssl/include -L/usr/local/ssl/lib -o test getX509info.o
Undefined first referenced
symbol in file
X509_get_issuer_name getX509info.o
ASN1_INTEGER_free getX509info.o
X509_new getX509info.o
d2i_X509_bio getX509info.o
PKCS12_free getX509info.o
X509_NAME_free getX509info.o
X509_get_serialNumber getX509info.o
Parse_SerialNumber getX509info.o
i2t_ASN1_OBJECT getX509info.o
PEM_read_bio_X509_AUX getX509info.o
Parse_Time getX509info.o
BIO_ctrl getX509info.o
ASN1_INTEGER_get getX509info.o
d2i_PKCS12_bio getX509info.o
X509_get_subject_name getX509info.o
BIO_s_file getX509info.o
PKCS12_parse getX509info.o
BIO_new getX509info.o
X509_NAME_oneline getX509info.o
ld: fatal: Symbol referencing errors. No output written to test
collect2: ld returned 1 exit status
make: *** [test] Error 1
是找不到库文件吗?
/usr/local/bin/gcc -O2 -fomit-frame-pointer -W -Wall -I/usr/local/ssl/include -L/usr/local/ssl/lib -c getX509info.c
getX509info.c: In function `main':
getX509info.c:32: warning: implicit declaration of function `load_cert'
getX509info.c:32: warning: assignment makes pointer from integer without a cast
getX509info.c:37: warning: too few arguments for format
getX509info.c:40: warning: implicit declaration of function `Parse_SerialNumber'
getX509info.c:62: warning: implicit declaration of function `Parse_Time'
getX509info.c:29: warning: unused variable `bp'
getX509info.c: At top level:
getX509info.c:78: warning: type mismatch with previous implicit declaration
getX509info.c:32: warning: previous implicit declaration of `load_cert'
getX509info.c:78: warning: `load_cert' was previously implicitly declared to return `int'
/usr/local/bin/gcc -O2 -fomit-frame-pointer -W -Wall -I/usr/local/ssl/include -L/usr/local/ssl/lib -o test getX509info.o
Undefined first referenced
symbol in file
X509_get_issuer_name getX509info.o
ASN1_INTEGER_free getX509info.o
X509_new getX509info.o
d2i_X509_bio getX509info.o
PKCS12_free getX509info.o
X509_NAME_free getX509info.o
X509_get_serialNumber getX509info.o
Parse_SerialNumber getX509info.o
i2t_ASN1_OBJECT getX509info.o
PEM_read_bio_X509_AUX getX509info.o
Parse_Time getX509info.o
BIO_ctrl getX509info.o
ASN1_INTEGER_get getX509info.o
d2i_PKCS12_bio getX509info.o
X509_get_subject_name getX509info.o
BIO_s_file getX509info.o
PKCS12_parse getX509info.o
BIO_new getX509info.o
X509_NAME_oneline getX509info.o
ld: fatal: Symbol referencing errors. No output written to test
collect2: ld returned 1 exit status
make: *** [test] Error 1
是找不到库文件吗?
|
X509_get_issuer_name getX509info.o
ASN1_INTEGER_free getX509info.o
X509_new getX509info.o
d2i_X509_bio getX509info.o
PKCS12_free getX509info.o
X509_NAME_free getX509info.o
X509_get_serialNumber getX509info.o
Parse_SerialNumber getX509info.o
i2t_ASN1_OBJECT getX509info.o
PEM_read_bio_X509_AUX getX509info.o
Parse_Time getX509info.o
BIO_ctrl getX509info.o
ASN1_INTEGER_get getX509info.o
d2i_PKCS12_bio getX509info.o
X509_get_subject_name getX509info.o
BIO_s_file getX509info.o
PKCS12_parse getX509info.o
BIO_new getX509info.o
X509_NAME_oneline getX509info.o
这些变量没有在getX509info中定义
或许你需要在getX509info中include一个头文件
或许在编译时需要连接一个库
ASN1_INTEGER_free getX509info.o
X509_new getX509info.o
d2i_X509_bio getX509info.o
PKCS12_free getX509info.o
X509_NAME_free getX509info.o
X509_get_serialNumber getX509info.o
Parse_SerialNumber getX509info.o
i2t_ASN1_OBJECT getX509info.o
PEM_read_bio_X509_AUX getX509info.o
Parse_Time getX509info.o
BIO_ctrl getX509info.o
ASN1_INTEGER_get getX509info.o
d2i_PKCS12_bio getX509info.o
X509_get_subject_name getX509info.o
BIO_s_file getX509info.o
PKCS12_parse getX509info.o
BIO_new getX509info.o
X509_NAME_oneline getX509info.o
这些变量没有在getX509info中定义
或许你需要在getX509info中include一个头文件
或许在编译时需要连接一个库
|
openssl ,偶不懂
在编译getX509info.c时,就有错误
在连接时,你没有指定link哪个libcrypto.so或者libssl.so
在编译getX509info.c时,就有错误
在连接时,你没有指定link哪个libcrypto.so或者libssl.so
|
你需要的库文件没有包含进来吧。