3

Hey guys I'm getting a weird g++ compile error while trying to run this C++ file, here's exact repro steps.

# install taglib-devel
$ sudo yum -y install taglib-devel 

$ cd /tmp && git clone https://gist.github.com/1468279.git; cd 1461468279/
$ gcc -g base64.c -lssl -c; 

# install cmake
$ sudo yum install cmake 
$ cd /tmp

# install taglib again =/
$ git clone git@github.com:taglib/taglib.git && cd taglib
$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_RELEASE_TYPE=Release .; make; sudo make install

$ cd /tmp/1461468279 && g++ -g -I. -I/usr/local/include/taglib -L/usr/local/lib -ltag -lssl setcover.cpp -o setcover base64.o


# response
/usr/bin/ld: base64.o: undefined reference to symbol 'BIO_ctrl@@libcrypto.so.10'
/usr/bin/ld: note: 'BIO_ctrl@@libcrypto.so.10' is defined in DSO /lib64/libcrypto.so.10 so try adding it to the linker command line
/lib64/libcrypto.so.10: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
4

2 回答 2

1

我认为您输入的命令缺少 -lcrypto

于 2019-04-29T15:29:37.577 回答
-1

g++ ... -L/usr/local/lib -ltag -lssl setcover.cpp -o setcover

上述命令不正确。要了解它为什么不正确以及如何修复它,请阅读.

于 2013-07-23T14:24:30.080 回答