libmodbus in MFC

旧街凉风 提交于 2019-12-20 06:07:59

问题


I am trying to integrate modbus library given by libmodbus into a custom MFC project in Visual Studio 2010.

The steps that I have followed till now are as follows:

1) I have created project in Visual Studio 2010 as shown in snapshots below:

2) I have edited the code to include a small hello world code just to check if it compiles.

3) I have copied .c and .h files from src folder of libmodbus-3.0.3 to Visual Studio project folder as shown below and included them in the project.

4) When I try to compile, it gives me following error:

My doubts are as follows:

1) Have I included libmodbus correctly in my project? Or is there a better or correct way to do the same?

2) How to eliminate the error that is coming: Cannot open include file: 'config.h'. No such file or directory.
I have seen that there is no config.h file in the libmodbus-3.0.3 that I have downloaded from http://libmodbus.org/download/
How to proceed ahead?

Thank you.


回答1:


Latest version of libmodbus provides Visual Studio project files.

https://github.com/stephane/libmodbus/tree/master/src/win32



来源:https://stackoverflow.com/questions/15976951/libmodbus-in-mfc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!