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
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
in src/makefile.lnx, but you'll probably want to do better than that (the non-debug version builds normally). Now here is the signal bt:
#0 0x40167df4 in ioctl () from /lib/libc.so.6 #1 0x4006bfcc in __svgalib_rendition_driverspecs () from /usr/lib/libvga.so.1 #2 0x080533f4 in inkey () at mouse/lnxinput.c:199 #3 0x0805366d in _GrCheckKeyboardHit () at mouse/lnxinput.c:281 #4 0x0805d5a1 in _GR_debug_printf (fmt=0x0) at utils/dbgprint.c:57 #5 0x0805925f in buildcontext (mp=0xbffff860, fdp=0xbffff880, cxt=0xbffff8e0) at setup/setmode.c:179 #6 0x080594b7 in GrSetMode (which=GR_custom_graphics) at setup/setmode.c:371 #7 0x0804fd44 in setgraphmode (mode=0) at bgi/bccgrx.c:408 #8 0x0804fed3 in __gr_initgraph (graphdriver=0x808046c, graphmode=0x0) at bgi/bccgrx.c:435 #9 0x0804ff7e in initgraph (graphdriver=0x0, graphmode=0x0, pathtodriver=0x0) at bgi/bccgrx.c:471 #10 0x08049c09 in Initialize () at bccbgi.c:279 #11 0x0804ee2e in main () at bccbgi.c:2196 #12 0x400b1541 in __libc_start_main () from /lib/libc.so.6
bgilink works normally. When using the debug version of grx, all programs display a blank screen, wait for esc to be hit and leave normally instead of immediately aborting with sigsegv (seems that sigsegv is trapped).
E-gards: Jimmy
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