cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.4k stars 291 forks source link

Basilisk II link fails due to missing X11 libraries: "undefined reference to symbol 'XConvertSelection'" #152

Closed dcoshea closed 6 years ago

dcoshea commented 6 years ago

On CentOS 7, with 1c9b21f plus some trivial unrelated changes, after ./configure --with-x, make fails with:

g++ -o BasiliskII -Wl,-T,ldscripts/linux-x86_64.ld  obj/main.o obj/prefs.o obj/prefs_items.o obj/sys_unix.o obj/rom_patches.o obj/slot_rom.o obj/rsrc_patches.o obj/emul_op.o obj/macos_util.o obj/xpram.o obj/xpram_unix.o obj/timer.o obj/timer_unix.o obj/adb.o obj/serial.o obj/ether.o obj/sony.o obj/disk.o obj/cdrom.o obj/scsi.o obj/video.o obj/audio.o obj/extfs.o obj/disk_sparsebundle.o obj/tinyxml2.o obj/user_strings.o obj/user_strings_unix.o obj/sshpty.o obj/strlcpy.o obj/rpc_unix.o obj/vm_alloc.o obj/sigsegv.o obj/video_blit.o obj/video_x.o obj/extfs_unix.o obj/serial_unix.o obj/ether_unix.o obj/scsi_linux.o obj/audio_oss_esd.o obj/prefs_editor_gtk.o obj/mon.o obj/mon_6502.o obj/mon_z80.o obj/mon_cmd.o obj/mon_disass.o obj/mon_ppc.o obj/mon_lowmem.o obj/floatformat.o obj/i386-dis.o obj/m68k-dis.o obj/m68k-opc.o obj/main_unix.o obj/prefs_unix.o obj/clip_unix.o obj/basilisk_glue.o obj/memory.o obj/newcpu.o obj/readcpu.o obj/fpu_ieee.o obj/cpustbl.o obj/cpudefs.o obj/cpuemu1.o obj/cpuemu2.o obj/cpuemu3.o obj/cpuemu4.o obj/cpuemu5.o obj/cpuemu6.o obj/cpuemu7.o obj/cpuemu8.o obj/bootp.o obj/ip_output.o obj/tcp_input.o obj/cksum.o obj/mbuf.o obj/tcp_output.o obj/debug.o obj/misc.o obj/tcp_subr.o obj/if.o obj/sbuf.o obj/tcp_timer.o obj/ip_icmp.o obj/slirp.o obj/tftp.o obj/ip_input.o obj/socket.o obj/udp.o -lpthread -lm -lrt -lrt -lreadline -lncurses  -lXxf86vm -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype  
/usr/bin/ld: obj/clip_unix.o: undefined reference to symbol 'XConvertSelection'
/lib64/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [BasiliskII] Error 1

-lX11 -lXext needs to be added to the command line to get this to succeed.

Further investigation shows that configure reported this error:

./configure: line 6355: [: missing `]'

The line number may not match what is in Git due to other changes I've made, but it refers to this line:

if [ "x$WANT_SDL_VIDEO" = "xno" -a "x$WANT_MACOSX_GUI" = "xno"]; then

The problem seems to be that c18d6fa removed a space from before the ]] in this line in BasiliskII/src/Unix/configure.ac:

if [[ "x$WANT_SDL_VIDEO" = "xno" -a "x$WANT_MACOSX_GUI" = "xno"]]; then

Adding the missing space fixes this.