FreeModbus LINUXTCP Compile ERROR
/*********************************************************************************
* FreeModbus LINUXTCP Compile ERROR
* 说明:
* 想使用FreeModbus TCP在Ubuntu上进行测试,结果其默认没有打开TCP功能。
*
* 2018-1-2 深圳 南山平山村 曾剑锋
********************************************************************************/ 一、参考文档:
. http://pl.comp.lang.c.narkive.com/3s8TevOZ/problem-z-kompilacj 二、报错信息:
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/demo.c:: undefined reference to `eMBTCPInit'
../../modbus/mb.o: In function `eMBInit':
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBRTUStart'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBRTUStop'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBRTUSend'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBRTUReceive'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `vMBPortClose'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `xMBRTUReceiveFSM'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `xMBRTUTransmitFSM'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `xMBRTUTimerT35Expired'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBRTUInit'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBASCIIStart'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBASCIIStop'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBASCIISend'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBASCIIReceive'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `vMBPortClose'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `xMBASCIIReceiveFSM'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `xMBASCIITransmitFSM'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `xMBASCIITimerT1SExpired'
/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP/../../modbus/mb.c:: undefined reference to `eMBASCIIInit'
collect2: error: ld returned exit status
Makefile:: recipe for target 'tcpmodbus' failed
make: *** [tcpmodbus] Error 三、解决办法:
. modified the file "freemodbus/modbus/include/mbconfig.h"
. find the under code
/*! \brief If Modbus ASCII support is enabled. */
#define MB_ASCII_ENABLED ( 1 )
/*! \brief If Modbus RTU support is enabled. */
#define MB_RTU_ENABLED ( 1 )
/*! \brief If Modbus TCP support is enabled. */
#define MB_TCP_ENABLED ( 0 )
/*! \brief The character timeout value for Modbus ASCII.
change into
#define MB_ASCII_ENABLED ( 0 )
#define MB_RTU_ENABLED ( 0 )
#define MB_TCP_ENABLED ( 1 ) 四、Compile Output:
root@localhost:/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP# make
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o demo.o -c demo.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o port/portother.o -c port/portother.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o port/portevent.o -c port/portevent.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o port/porttcp.o -c port/porttcp.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/mb.o -c ../../modbus/mb.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/tcp/mbtcp.o -c ../../modbus/tcp/mbtcp.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/functions/mbfunccoils.o -c ../../modbus/functions/mbfunccoils.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/functions/mbfuncdiag.o -c ../../modbus/functions/mbfuncdiag.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/functions/mbfuncholding.o -c ../../modbus/functions/mbfuncholding.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/functions/mbfuncinput.o -c ../../modbus/functions/mbfuncinput.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/functions/mbfuncother.o -c ../../modbus/functions/mbfuncother.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/functions/mbfuncdisc.o -c ../../modbus/functions/mbfuncdisc.c
gcc -g -Wall -Iport -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include -I../../modbus/tcp -pthread -o ../../modbus/functions/mbutils.o -c ../../modbus/functions/mbutils.c
gcc demo.o port/portother.o port/portevent.o port/porttcp.o ../../modbus/mb.o ../../modbus/tcp/mbtcp.o ../../modbus/functions/mbfunccoils.o ../../modbus/functions/mbfuncdiag.o ../../modbus/functions/mbfuncholding.o ../../modbus/functions/mbfuncinput.o ../../modbus/functions/mbfuncother.o ../../modbus/functions/mbfuncdisc.o ../../modbus/functions/mbutils.o -lpthread -o tcpmodbus
root@localhost:/home/zengjf/freemodbus/freemodbus-v1.5.0/demo/LINUXTCP#
FreeModbus LINUXTCP Compile ERROR的更多相关文章
- VBA Excel WideCharToMultiByte Compile error on 64-bit System
Compile Error: The code in this project must be updated for use on64-bit systems. Please review and ...
- OK335xS canutils deal with compile error
/************************************************************************************** * OK335xS ca ...
- Handling CLIK AS3 Compile Error 1152 & 5000
Handling CLIK AS3 Compile Error 1152 & 5000 Action You add a CLIK AS3 component from CLIK_Compon ...
- caffe: compile error : undefined reference to `cv::imread(cv::String const&, int)' et al.
when I compile caffe file : .build_debug/lib/libcaffe.so: undefined reference to `cv::imread(cv::Str ...
- ASIHTTPREQUEST framework compile error when method is called / link error
never mind!!! duplicate: Error with iOS 5.1 when i use ASIHTTPRequest and SBJSON "I would take ...
- caffe: fuck compile error again : error: a value of type "const float *" cannot be used to initialize an entity of type "float *"
wangxiao@wangxiao-GTX980:~/Downloads/caffe-master$ make -j8find: `wangxiao/bvlc_alexnet/spl': No suc ...
- compile error
stray \241 程序有非法字符,如空格,引号等,一般因为从别的地方粘贴导致这个错误.
- caffe: compile error: Could not open or find file your path~~/resized_data/0 and a total of 2 images .
I0219 14:48:40.965386 31108 net.cpp:76] Memory required for data: 0I0219 14:48:40.965517 31108 layer ...
- Visual Studio Code compile error - launch.json must be configured...
一.在最初使用VS Code创建控制台应用时, 使用VS Code调试工具默认会跑出异常: launch: program 'launch: launch.json must be configure ...
随机推荐
- [洛谷 P2709] 小B的询问
P2709 小B的询问 题目描述 小B有一个序列,包含N个1~K之间的整数.他一共有M个询问,每个询问给定一个区间[L..R],求Sigma(c(i)^2)的值,其中i的值从1到K,其中c(i)表示数 ...
- 一、JDBC
一.CRUD(增删改查) C:增加Create R查询(Retrieve) U更新(Update) D删除(Delete) 在JDBC中,增加,删除,修改,操作都基本一样,只是传递不同SQL语句,最后 ...
- vue-router 按需加载
vue的单页面(SPA)项目,必然涉及路由按需的问题.以前我们是这么做的 //require.ensure是webpack里面的,这样做会将单独拉出来作为一个chunk文件 const Login = ...
- error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because
ubuntu 命令行sudo apt-get update W: GPG error: http://ppa.launchpad.net lucid Release: The following si ...
- linux文件管理 文件操作
文件操作 pwd 命令 该命令的英文解释为print working direction(打印工作目录).输入pwd命令,Linux输出当前目录. cd 命令 用来改变所在目录 cd / 转到根目录 ...
- linux 安装 DenyHosts 防止密码被暴力破解
DenyHosts DenyHosts是Python语言写的一个程序,它会分析sshd的日志文件(/var/log/secure),当发现重 复的攻击时就会记录IP到/etc/hosts.deny文件 ...
- 深入理解 Java 虚拟机——走近 Java
1.1 - 概述 Java 总述:Java 不仅是一门编程语言,还是一个由一系列 计算机软件 和 规范 形成的技术体系,这个技术体系提供了完整的用于软件开发和跨平台部署的支持环境,并广泛应用于 嵌入式 ...
- ssh三大框架整合
spring+struts2+hibernate 参考1:数据库为oracle http://takeme.iteye.com/blog/1678268 参考2:数据库为mysql http://bl ...
- HTML编辑笔记4
1.CSS(层叠样式表) 2.CSS语法 选择器{ 属性名1:属性值1: 属性名2:属性值2: } 3.引用CSS的三种方式 第一种:行内样式 例:<a style="color:re ...
- PC/FORTH 判定
body, table{font-family: 微软雅黑} table{border-collapse: collapse; border: solid gray; border-width: 2p ...