HalView - view HAL pin values externally in C++
The error is that it cannot find the header file. I did an export to include the location in the path.
Where did you export it?
$PATH is only used for binaries, ie executable programs
You need to export LDFLAGS for libraries and either CFLAGS or CPPFLAGS for includes (see which one the Makefile uses)
Easiest way is to put them in your ~/.bash.rc file
regards
PS
As you are using Qt, you could put it in the INCLUDEPATH string in the halview.pro file, then remake the Makefile with qmake -makefile from the dir with the pro file in it
Please Log in or Create an account to join the conversation.
Halview did actually build correctly it is the component redisclient.comp that is give me crap.
In a terminal I did the export and I did the rip-environment. Then used comp to compile the comp.
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
In a terminal I did the export and I did the rip-environment. Then used comp to compile the comp.
You can export the same way with CFLAGS or just copy hiredis.h into one of the include dirs that are in the include path, probably simpler
(or even put a copy in the directory with the comp file, the first place it looks is I.)
Please Log in or Create an account to join the conversation.
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
Looking at the Makefile, by default it installs to /usr/local/include/hiredis and /usr/local/lib
Those are not in your gcc line and you will hit problems with linking even after you get it to compile, if you have not set them.
Try running a cut and paste of this from the commandline, does that find the header and lib?
gcc -Os -g -I. -I/usr/realtime-2.6.32-122-rtai/include -I/usr/local/include/hiredis -D_FORTIFY_SOURCE=0 -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/home/marius/dev/linuxcnc-dev/include -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o redisclient /tmp/tmpRfXK3r/redisclient.c -Wl,-rpath,/home/marius/dev/linuxcnc-dev/lib -L/usr/local/lib -L/home/marius/dev/linuxcnc-dev/lib -llinuxcnchal -lhiredis
EDIT
Forgot you have to produce a c file first with comp
comp redisclient.comp will produce redisclient.c
Assuming the other stuff in your gcc line was right, this should build the binary
color=#0000ff]gcc -Os -g -I. -I/usr/realtime-2.6.32-122-rtai/include -I/usr/local/include/hiredis -D_FORTIFY_SOURCE=0 -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/home/marius/dev/linuxcnc-dev/include -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o redisclient redisclient.c -Wl,-rpath,/home/marius/dev/linuxcnc-dev/lib -L/usr/local/lib -L/home/marius/dev/linuxcnc-dev/lib -llinuxcnchal -lhiredis[/color]
Please Log in or Create an account to join the conversation.
marius@cnc-dev:~/programs/halview$ gcc -Os -g -I. -I/usr/realtime-2.6.32-122-rtai/include -I/usr/local/include/hiredis -D_FORTIFY_SOURCE=0 -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/home/marius/dev/linuxcnc-dev/include -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o redisclient /tmp/tmpRfXK3r/redisclient.c -Wl,-rpath,/home/marius/dev/linuxcnc-dev/lib -L/usr/local/lib -L/home/marius/dev/linuxcnc-dev/lib -llinuxcnchal -lhiredis
gcc: /tmp/tmpRfXK3r/redisclient.c: No such file or directory
marius@cnc-dev:~/programs/halview$
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
EDIT
Forgot you have to produce a c file first with comp
comp redisclient.comp will produce redisclient.c
Assuming the other stuff in your gcc line was right, this should build the binary (in the same dir that redisclient.c is)
gcc -Os -g -I. -I/usr/realtime-2.6.32-122-rtai/include -I/usr/local/include/hiredis -D_FORTIFY_SOURCE=0 -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/home/marius/dev/linuxcnc-dev/include -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o redisclient redisclient.c -Wl,-rpath,/home/marius/dev/linuxcnc-dev/lib -L/usr/local/lib -L/home/marius/dev/linuxcnc-dev/lib -llinuxcnchal -lhiredis
Please Log in or Create an account to join the conversation.
marius@cnc-dev:/$ sudo find | grep hiredis.h
[sudo] password for marius:
./home/marius/programs/redis/redis-2.8.13/deps/hiredis/hiredis.c
./home/marius/programs/redis/redis-2.8.13/deps/hiredis/hiredis.o
./home/marius/programs/redis/redis-2.8.13/deps/hiredis/hiredis.h
./home/marius/programs/hiredis-master/hiredis.h
./home/marius/programs/halview/hiredis.h
./usr/local/include/hiredis/hiredis.h
marius@cnc-dev:/$
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
With the Include and Lib dirs specified and redisclient.c created, it should build
Please Log in or Create an account to join the conversation.
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.