Shell Scripts to Update FiveLinux libraries.
Posted: Mon Sep 08, 2008 12:13 pm
Hi Antonio
I am writing shell scripts to update the FiveLinux libraries from the source you provide as modified. In doing so I discovered that printers.c won't compile - not because of any direct problem with your code but rather due to an issue with the libgnomeprint libraries. Your code includes them as:
whereas given where apt-get install puts them they would have to be included as:
which you would think would fix matters but unfortunately these files include other libgnomeprint files. For example the following is in gnome-print.h
So the libgnomeprint authors must have intended a different location for these files and / or changed things and not realised what they had done. But there doesn't seem to be any update at least in the Ubuntu repositories.
In case anyone is interested here is a shell script to update libfivex.a:
It should be copied to fivelinux/source/classes and run from there.
Here's one for updating libfivec.a:
I have left printers.c out of this for the reasons above.
Regards
Doug
PS I got four cast warnings from compilation of msgbox.c
I am writing shell scripts to update the FiveLinux libraries from the source you provide as modified. In doing so I discovered that printers.c won't compile - not because of any direct problem with your code but rather due to an issue with the libgnomeprint libraries. Your code includes them as:
Code: Select all
#include <libgnomeprint/gnome-print.h>
#include <libgnomeprint/gnome-print-job.h>
#include <libgnomeprintui/gnome-print-dialog.h>
Code: Select all
#include <libgnomeprint-2.2/libgnomeprint/gnome-print.h>
#include <libgnomeprint-2.2/libgnomeprint/gnome-print-job.h>
#include <libgnomeprint-2.2/libgnomeprintui/gnome-print-dialog.h>
Code: Select all
#include <libgnomeprint/gnome-print-config.h>
#include <libgnomeprint/gnome-font.h>
#include <libgnomeprint/gnome-glyphlist.h>
In case anyone is interested here is a shell script to update libfivex.a:
Code: Select all
#!/bin/bash
# updclassesx.sh
check_errs()
{
# Parameter 1 is the return code
# Parameter 2 is text to display on failure.
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
exit ${1}
fi
}
compile_prg()
{
# Parameter 1 is the module name
echo compiling $1.prg xHarbour code to C code
./../../../xharbour/bin/harbour $1.prg -n -I./../../include -I./../../../xharbour/include -q0
check_errs $? "compiling ${1}.prg"
echo compiling $1.c to object code
gcc $1.c -c -I./../../include -I./../../../xharbour/include `pkg-config --cflags gtk+-2.0`
check_errs $? "compiling ${1}.c"
rm $1.c
echo updating libfivex.a with $1.o
ar rc ./../../lib/libfivex.a ./$1.o
rm $1.o
}
sources="bar
button
checkbox
clipboard
combobox
control
dialog
folder
get
group
image
listbox
menu
menuitem
mget
msgbar
pdmenu
printer
progres
radio
radmenu
say
scrollbar
timer
wbcolumn
wbrowse
window"
echo
echo Updating xHarbour classes
echo
for m in ${sources}
do
compile_prg ${m}
done
echo done!
It should be copied to fivelinux/source/classes and run from there.
Here's one for updating libfivec.a:
Code: Select all
#!/bin/bash
# updwinapix.sh
check_errs()
{
# Parameter 1 is the return code
# Parameter 2 is text to display on failure.
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
exit ${1}
fi
}
compile_c()
{
# Parameter 1 is the module name
echo compiling $1.c to object code
gcc $1.c -c -I./../../include -I./../../../xharbour/include `pkg-config --cflags gtk+-2.0`
check_errs $? "compiling ${1}.c"
echo updating libfivex.c with $1.o
ar rc ./../../lib/libfivex.c ./$1.o
rm $1.o
}
sources="bars
buttons
checkboxes
clipboards
comboboxes
dialogs
folders
getcolor
getfile
getfont
gets
groups
images
listboxes
menus
mgets
msgbars
msgbox
progress
radios
says
scrollbars
wbrowses
windows"
echo
echo Updating xHarbour classes
echo
for m in ${sources}
do
compile_c ${m}
done
echo done!
Regards
Doug
PS I got four cast warnings from compilation of msgbox.c