编译时未定义的引用

时间:2014-02-01 15:33:57

标签: c++ compiler-construction reference linker

我正在尝试将二进制文件添加到ARM处理器中。 我有源代码,我正在尝试进行所有修改,以便可以编译。

我认为一切都已完成,我尝试编译它,因为“makefile”说,但错误被抛出:

/usr/bin/ld: /tmp/ccTN4uMT.o: undefined reference to symbol 'RAND_bytes'
/usr/bin/ld: note: 'RAND_bytes' is defined in DSO /usr/lib/libcrypto.so.1.0.0 so try adding it to the linker command line
/usr/lib/libcrypto.so.1.0.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

据我所知,我必须在编译代码中指定“libcrypto.so.1.0.0”,但我不知道我必须在哪里引用它。

使用过的命令是:

sudo gcc -O3 -fexpensive-optimizations -ffast-math -funroll-loops -fomit-frame-pointer foo1.cpp foo2.cpp foo3.cpp foo4.cpp foo5.cpp -lssl -o mybinary

0 个答案:

没有答案