hi all,
have problems modbus communications ardushield raspberry. testing "cookinghacks" library , wasn't stable , fails or give me errors transmissions, decided change libmodbus library github.
have downloaded it, extracted correctly , afterwards: (first generate configure script if required) here solved problems of installing executing process root permissions.
after done (maybe not done), tried compile 1 of examples in /test directory inside ; here when errors appear:
errors this;
need guidelines install , compilation please!
have problems modbus communications ardushield raspberry. testing "cookinghacks" library , wasn't stable , fails or give me errors transmissions, decided change libmodbus library github.
have downloaded it, extracted correctly , afterwards:
code: select all
./configure && make install
code: select all
./autogen.sh
after done (maybe not done), tried compile 1 of examples in /test directory inside ;
code: select all
gcc random-test-server.c -o random-test-server 'pkg-config --libs --cflags libmodbus'
if file "modbus.h" in same directory.random-test-client.c:15:20: fatal error: modbus.h: no such file or directory
errors this;
have tried move lot of files between directories , impossible compilation done library.gcc: error: pkg-config: no such file or directory
gcc: error: libmodbus: no such file or directory
gcc: error: unrecognized command line option ‘--libs’
gcc: error: unrecognized command line option ‘--cflags’
need guidelines install , compilation please!
will help? it's makefile project using libmodbus installed per instructions
code: select all
# # solid makefile # cc = gcc cflags = -c -wall ldflags = -rdynamic -lrt -lm -ldl -lpthread inc = -i/usr/include/modbus # list of sources: sources = ab_client.c objects = $(sources:.c=.o) # name of executable target: executable = ab_client cflags += `pkg-config --cflags libmodbus` cflags += `pkg-config --cflags gtk+-3.0` ldflags += `pkg-config --libs libmodbus` ldflags += `pkg-config --libs gtk+-3.0` all: $(sources) $(executable) $(executable): $(objects) $(cc) $(objects) -o $@ $(ldflags) .c.o: $(cc) $(inc) $(cflags) $< -o $@ clean: rm $(objects) $(executable)
raspberrypi
Comments
Post a Comment