作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用libfluid来编码我自己的OpenFlow Controller 。但是首先,我想构建sample controller以了解其工作原理。
编译样本 Controller 时出现以下错误:(这是我尝试make msg_controller
时遇到的错误)
c++ msg/MsgController.cc -lfluid_msg -lfluid_base -I. -O3 -std=c++0x -o msg_controller
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libfluid_base.so: undefined reference to `event_base_del_virtual'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libfluid_base.so: undefined reference to `event_base_add_virtual'
collect2: error: ld returned 1 exit status
Makefile:10: recipe for target 'msg_controller' failed
make: *** [msg_controller] Error 1
libfluid_base
和
libfluid_msg
。构建这两个库时,出现以下提示,我认为这可能有助于解决我的问题
If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages.
grep -rn "event_base_del" /usr/lib
和
grep -rn "event_base_add" /usr/lib
event_base_del
的输出如下(
event_base_add
相同)
Binary file /usr/lib/libfluid_base.a matches
Binary file /usr/lib/libfluid_base.so.0.0.0 matches
Binary file /usr/lib/x86_64-linux-gnu/libevent.a matches
Binary file /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2 matches
Binary file /usr/lib/x86_64-linux-gnu/libevent_core.a matches
Binary file /usr/lib/x86_64-linux-gnu/libevent_core-2.1.so.6.0.2 matches
libfluid_base.so
只是
libfluid_base.so.0.0.0
的链接
lrwxrwxrwx 1 root root 22 Oct 8 09:36 libfluid_base.so -> libfluid_base.so.0.0.0
最佳答案
event_base_del_virtual
来自libevent library。将其与-levent_core
链接。
关于c++ - 编译libfluid示例 Controller 时未定义对 'event_base_del_virtual'的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52704269/
我是一名优秀的程序员,十分优秀!