LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "Make" error: /usr/bin/lds cannot find -lxt (https://www.linuxquestions.org/questions/linux-newbie-8/make-error-usr-bin-lds-cannot-find-lxt-4175623622/)

dlfallen 02-12-2018 08:22 PM

"Make" error: /usr/bin/lds cannot find -lxt
 
Long time computer user but new to linux. I am using Linux Mint 18.3.

I would like to use the TRS-80 emulator sdltrs. I downloaded the archive file for the sdltrs distribution and extracted the files. I then used the terminal to go to the correct source directory (in my case, dave/Downloads/sdltrs_1_1_0/src/linux. Then,as directed, I entered the make command in the terminal. It goes a long way toward building the executable file, but eventually exits with the error messages:
/usr/bin/ld: cannot find -lxt
collect2:error: ld returned 1 exit status
Makefile:20: recipe for target 'sdltrs' failed
make: *** [sdltrs] Error 1

I took a look at the ld folder. Turns out it is a symlink for
x86_64-linux-gnu-ld which is a symlink for
ld.bft which is a symlink for
x86_64-linux-gnu-ld.bfd which is a Program (application/x-executable)

At this point I do not know how to proceed. What do I have to do to get this makefile finish completely? Any help would be appreciated.

AwesomeMachine 02-12-2018 09:14 PM

Why don't you try
Code:

$ apt-cache search trs 80
and install one the emulators that comes up. Otherwise, if you really want to build from source, you have to read which dependencies are required for sdltrs, and install them using apt. At the very least you probably need libsdl. See this http://forums.debian.net/viewtopic.php?f=16&t=67657

and maybe this http://sdltrs.sourceforge.net/docs/index.html

dlfallen 02-12-2018 10:29 PM

Thanks AwesomeMachine. I really don't want to build from source, but I really do want to install sdltrs and building it seems to be the only option. I already have xtrs installed (sdltrs is based on xtrs). I like your search tip
Code:

$ apt-cache search trs 80
which I will add to my bag of tricks.

I am aware of dependencies and I had installed
Code:

sudo apt-get install libsdl1.2-dev
prior to attempting the build. I looked at the link you provided to the Debian User Forums and based on what I saw their ran
Code:

sudo apt-get install build-essential linux-headers-$(uname -r)
I still generate the original error message when I attempt the build.

frankbell 02-12-2018 10:46 PM

A recent episode of the Sunday Morning Linux Review discussed the TRS-80. They mentioned that part of the firmware is copyright and that legitimate valid emulators are therefore not available.

I personally know nothing one way or the other, but offer this because it may shed light on this issue.

Aside: A long time ago, I knew a couple of training consultants who were also a couple who used a TRS-80 for their business. In the context of the times, they were quite happy with it, but they did tend to refer to it as a "Trash 80."

AwesomeMachine 02-13-2018 09:55 PM

The linker (ld) is looking for a library called 'xt'. That could be libXext.so, but I kind of doubt it. Try this
Code:

$ strace make
for the make command command. When the trace stops, see if you can find which file ld is looking for.

After you find out, use the 'locate' command to find that file on the system. You might have to run 'updatedb' first. It might help if you could post a few more lines before the error in make. The bottom line is, ld can't find some library it needs for the compile.

You could also try
Code:

$ ld -lxt --verbose
to find the name of the files. In the makefile there is a variable called 'LDFLAGS'. After you find the library, edit the makefile to read "LDFLAGS=-L/path/to/library/location/".

And that page I gave you tells where to get the ROM images for sdltrs.

knudfl 02-14-2018 06:28 AM

-lxt means libxt.so ( or libxt.a )

$ apt install libxt-dev
... provides
/usr/lib/x86_64-linux-gnu/libXt.a
/usr/lib/x86_64-linux-gnu/libXt.so
https://packages.ubuntu.com/xenial/a...t-dev/filelist

-

dlfallen 02-14-2018 02:16 PM

Thanks to all who all who helped me. The issue is resolved and I really appreciate it.

knudfl put me on the right track by providing me with
Code:

$ apt install libxt-dev
That got rid of the pesky "cannot find -lxt" error. Instead, I got "undefined reference to symbol 'XConvertSelection'". Fortunately, I was aware of the solution to that problem on https://rmcore.com/trs-80-emulator-ubuntu-14-04/
That solution was to "modify the Makefile under src/linux. I changed the LIBS line to add a dependency on X11.

LIBS = -lSDL -lXt -lX11"

Once I did that, I was able to complete the makefile process and now have an executable sdltrs program.

Great help guys, and spot on!

hello _world 08-04-2020 12:15 AM

same problem
 
I'm having the same problem with this binary. I've tried everything mentioned so far, including updating the make file.

I get this output when I run make:
_______________________________

make
gcc blit.o debug.o dis.o error.o load_cmd.o load_hex.o main.o trs_mkdisk.o trs_cassette.o trs_chars.o trs_disk.o trs_hard.o trs_imp_exp.o trs_interrupt.o trs_io.o trs_memory.o trs_printer.o trs_rom1.o trs_rom3.o trs_rom4p.o trs_sdl_gui.o trs_sdl_interface.o trs_sdl_keyboard.o trs_state_save.o trs_uart.o z80.o sdltrs_main.o PasteManager.o -o "sdltrs" -lSDL -lXt -lx11
/usr/bin/ld: cannot find -lx11
collect2: error: ld returned 1 exit status
make: *** [Makefile:20: sdltrs] Error 1

________________________________


and I can't find lx11 either.

hello _world 08-04-2020 12:18 AM

this is what is outputted with the unmodified make file:

______________________________________

make
gcc blit.o debug.o dis.o error.o load_cmd.o load_hex.o main.o trs_mkdisk.o trs_cassette.o trs_chars.o trs_disk.o trs_hard.o trs_imp_exp.o trs_interrupt.o trs_io.o trs_memory.o trs_printer.o trs_rom1.o trs_rom3.o trs_rom4p.o trs_sdl_gui.o trs_sdl_interface.o trs_sdl_keyboard.o trs_state_save.o trs_uart.o z80.o sdltrs_main.o PasteManager.o -o "sdltrs" -lSDL -lXt
/usr/bin/ld: PasteManager.o: undefined reference to symbol 'XConvertSelection'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:20: sdltrs] Error 1
________________________________________

any help would be greatly appreciated!

hello _world 08-04-2020 10:08 PM

well, I found one problem. The "X" in X11 has to be capitalized. so that works. but I end up still without a compiled binary.

hello _world 08-04-2020 10:26 PM

ok, learned something new. not sure why I didn't know this before. typing ./sdltrs makes it run. Now I just need to figure out how to install rom file and configure.


All times are GMT -5. The time now is 03:23 AM.