嘿家伙我在尝试运行这个C ++文件时遇到了一个奇怪的g ++编译错误,这里是精确的重复步骤。
# 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 [email protected]: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
g ++ ... -L / usr / local / lib -ltag -lssl setcover.cpp -o setcover
以上命令不正确。要了解它为什么不正确,以及如何解决它,请阅读this。
我认为在你输入的命令中缺少-lcrypto