今天晚上编译一个libnids方面的程序。头文件包含了"libnids.h"。但是编译的时候还是出错。如下:

tmp/ccnCpNW6.o: In function `main':

sample.c:(.text+0x331): undefined reference to `nids_init'
sample.c:(.text+0x33d): undefined reference to `nids_register_tcp'
sample.c:(.text+0x342): undefined reference to `nids_run'

collect2: ld returned 1 exit status

后来查了下。原来是我编译的方式不对。

libnids库编译的时候需要pcap和net库,所以编译参数不对
应该为 gcc -g -o test test.c -lnids -lpcap -lnet。

成功。

undefined reference to `nids_init'相关推荐

  1. undefined reference to 'pthread_create'问题解决(转)

    undefined reference to 'pthread_create' undefined reference to 'pthread_join' 问题原因:     pthread 库不是 ...

  2. undefined reference to `libiconv_open 无法编译PHP libiconv

    原文:http://hi.baidu.com/ostech/blog/item/a63f9b0dabed1ae7ab6457d0.html ./configure --with-mysql=/back ...

  3. 【Qt】error: undefined reference to `vtable for MainWindow‘

    1.问题描述 在写一个demo时,想尽量简单,就把MainWindow类的定义和实现都写在main.cpp中,结果编译时报错: main.cpp:-1: error: undefined refere ...

  4. 【Qt】报错error: undefined reference to `vtable for的解决方法

    1.问题描述 编译Qt程序时,在某个类构造函数定义处报错: error: undefined reference to `vtable for 2.原因分析 导致错误信息的原因是:子类没有实现父类的纯 ...

  5. 【ffmpeg】编译时报错:error: undefined reference to `av...

    1.问题描述 昨天使用ffmpeg库编译demo一切正常,今天再次链接ffmpeg库时报了一堆错误: error: undefined reference to `av_frame_alloc()' ...

  6. undefined reference to android log print,undefined reference to '__android_log_print'

    场景:undefined reference to `android_log_print' undefined reference to `__android_log_print' 原因:没有加入支持 ...

  7. undefined reference to 'WinMain@16' 的四种情况

    undefined reference to 'WinMain@16' 意思为提示找不到 WinMain 函数,WinMain是windows程序的入口函数,有几种可能: int main() 写成了 ...

  8. 报错解决:undefined reference to `snappy::MaxCompressedLength(unsigned long)'

    下午在编译phxpaxos的样例时报错了,报错如下: g++ echo_sm.o echo_server.o main.o -o phxecho -L/home/zhang/phxpaxos/.lib ...

  9. 重新编译php又出错了。undefined reference to `php_xx

    2019独角兽企业重金招聘Python工程师标准>>> main/rfc1867.lo(.text+0x1c): In function `php_mb_flush_gpc_vari ...

最新文章

  1. 查看照片的指定位置的像素点值,并在照片中绘制一条指定像素颜色的线段
  2. LeetCode 1944. 队列中可以看到的人数(单调栈)
  3. js设计一个带开关的时钟_数电题:三个按键一个灯
  4. mysql 的节点组是什么_什么是MySQL集群
  5. 信息学奥赛一本通(1078:求分数序列和)
  6. 【转载 待读】卷积神经网络
  7. php ob缓存原理介绍
  8. jquery-file-upload限制文件上传大小和文件个数
  9. cocos2d-x性能优化的那些事
  10. 爆强!将 exe 文件反编译成 Python 脚本!
  11. oracle 数值加减乘除
  12. 小程序 Rsa加密
  13. java excel poi 包_用java poi包读取Excel单元格
  14. 装系统后恢复U盘容量
  15. php-fpm端口占用无法启动
  16. 如何看待 Google 最新的系统 Fuchsia?
  17. 27个强大的PDF在线工具,完全免费!
  18. Matlab使用串口进行数据通信
  19. vue部分面试题分享
  20. matlab结果中有虚数,Matlab数值积分结果是虚数

热门文章

  1. 这套ai的思维让我感到了一个细思极恐的开源项目
  2. 【阿里巴巴百川掌中测 限量内测招募啦】来自阿里的移动开发测试洪荒之力
  3. Windows 怎么查看是否已经真正激活
  4. Uinux/linux vi保存退出命令 (如何退出vi)
  5. GSM6.10转码与wav文件保存
  6. FME中WorkspaceRunner传参处理
  7. 【矩阵论笔记】最小多项式与Jordan型的关系
  8. 禅意Python - The Zen of Python
  9. 推荐这三款软件让你实现图片去雾化?
  10. 基于RHEL7进行grub加密和解密