Dimitar Zhekov escribió:
I tried to test macroi16.dif under linux as promised, but got problems. Any (_not_ bgi only) grx program attempting to set graphics mode failed with sigsegv. I had the same problem with grx244 too since (_if_ I remebmer correctly) the upgrade to svgalib-1.9.13/devfs. All other svgalib programs (MPlayer, zgv, asteroids) work - the problem is specific to grx programs.
This time I decided to build a debug version of grx and see what goes on, but there is another error:
make -C src -f makefile.lnx make[1]: Entering directory `/tmp/grx/src' gcc -o ../bin/fnt2c utilprog/fnt2c.o ../lib/unix/libgrx20.a ../lib/unix/libgrx20.a(lnxinput.o): In function `GrMouseDetect': /tmp/grx/src/mouse/lnxinput.c:337: undefined reference to `vga_getmousetype' /tmp/grx/src/mouse/lnxinput.c:337: undefined reference to `mouse_init_return_fd' /tmp/grx/src/mouse/lnxinput.c:344: undefined reference to `mouse_close'
<more undefined references> collect2: ld returned 1 exit status make[1]: *** [../bin/fnt2c] Error 1 make[1]: Leaving directory `/tmp/grx/src' make: *** [libs] Error 2
You don't need debug at all! Make is telling you it doesn't found the svgalib functions.
I supose you installed svgalib by hand (as I did), so the shared libraries are in /usr/local/lib. You need to: a) move the libraries to /usr/lib or b) (I prefer this) edit the /etc/ld.so.conf file and add /usr/local/lib. In either case you need to run "ldconfig" as root to permit linux to know about the new shared libraries.
The example svglib programs work because the makefile now where it built them. Is the same with the grx examples.
This can be quickly fixed by a:
ifdef DEBUG $(UTILP): ../bin/% : utilprog/%.o $(GRX20ST) $(CC) -o $@ utilprog/$*.o $(GRX20ST) -lvga -lm $(STRIP) $@ else $(UTILP): ../bin/% : utilprog/%.o $(GRX20ST) $(CC) -o $@ utilprog/$*.o $(GRX20ST) $(STRIP) $@ endif
Not a good idea to strip the libvga for a svgalib program.
Regards, M.Alvarez