libmodbus for ARM

Asked by Indrajeet Tupe

hi all,
i hav downloaded libmodbus-2.0.3 and want to compile my application for ARM9. I hav followed the steps like: ./configure,make,make install.....
then i tried to compile my application with the command-

[root@localhost 18-05-10]# arm-linux-gcc -o dan_ser danfoss_app_library.c
danfoss_app_library.c:19:27: error: modbus/modbus.h: No such file or directory
danfoss_app_library.c: In function 'main':
danfoss_app_library.c:41: error: 'modbus_param_t' undeclared (first use in this function)
danfoss_app_library.c:41: error: (Each undeclared identifier is reported only once
danfoss_app_library.c:41: error: for each function it appears in.)
danfoss_app_library.c:41: error: expected ';' before 'mb_param'
danfoss_app_library.c:49: error: 'mb_param' undeclared (first use in this function)

i got the above error...
it says no file for modbus.h.. how to solve this..
can any one guide me further...
Thanks in advance

Question information

Language:
English Edit question
Status:
Answered
For:
libmodbus Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marco (emmeci) said :
#1

hi,
you have to include modbus headers in your gcc path (<gcc> -l <path to
modbus dir>)
I'm not sure of the syntax, please check using gcc help

bye

On Tue, May 18, 2010 at 12:10 PM, Indrajeet Tupe <
<email address hidden>> wrote:

> New question #111449 on libmodbus:
> https://answers.launchpad.net/libmodbus/+question/111449
>
> hi all,
> i hav downloaded libmodbus-2.0.3 and want to compile my application for
> ARM9. I hav followed the steps like: ./configure,make,make install.....
> then i tried to compile my application with the command-
>
> [root@localhost 18-05-10]# arm-linux-gcc -o dan_ser danfoss_app_library.c
> danfoss_app_library.c:19:27: error: modbus/modbus.h: No such file or
> directory
> danfoss_app_library.c: In function 'main':
> danfoss_app_library.c:41: error: 'modbus_param_t' undeclared (first use in
> this function)
> danfoss_app_library.c:41: error: (Each undeclared identifier is reported
> only once
> danfoss_app_library.c:41: error: for each function it appears in.)
> danfoss_app_library.c:41: error: expected ';' before 'mb_param'
> danfoss_app_library.c:49: error: 'mb_param' undeclared (first use in this
> function)
>
> i got the above error...
> it says no file for modbus.h.. how to solve this..
> can any one guide me further...
> Thanks in advance
>
> --
> You received this question notification because you are a member of
> Modbus Team, which is an answer contact for libmodbus.
>

Revision history for this message
Indrajeet Tupe (indrajeet-tupe) said :
#2

thanks for ur reply.. I did d same before posting my query.. but it also didnt work.. did u compiled the applications for any development board having ARM processor..
If anybody has worked on it previously plz guide me.. its urgent for me to get it worked...
The thing is I hav a development board having ARM9 on it.. its connected to the drive through modbus.. I hav to communicate wit it.. I am able to write to the drive but not able to read.. so I want to use libmodbus for the same..
I hav written the application but now want to compile it for arm board n m using cross compiler arm-linux-gcc-4.3.2
but hav errors in compiling it.. it is working properply for gcc compiler.. but not for cross compiler..
I hav followed proper step.. It would be great if someone can guide me wit proper steps...
Thanks in advance....

Revision history for this message
Steven Hsu (sintsu1101) said :
#3

You can try just copy the modbus.h (under libmodbus/src folder) in the same folder with the file you want to compile

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Stéphane Raimbault (sra) said :
#5

gcc -I/usr/...

Can you help with this problem?

Provide an answer of your own, or ask Indrajeet Tupe for more information if necessary.

To post a message you must log in.