mohd-akram/st

Linker issues

larsbrinkhoff opened this issue · 1 comments

Hello,

Great job, I'm excited to see this! (CC @sebras)

Using your Makefile, I get linker errors. This is the command and some of the messages.

cc   -lSDL2 -lSDL2_ttf  st.c   -o st
/usr/bin/ld: /tmp/ccISkhgJ.o: in function `vec':
st.c:(.text+0x25d): undefined reference to `SDL_SetRenderDrawColor'
/usr/bin/ld: st.c:(.text+0x295): undefined reference to `SDL_RenderDrawLine'
/usr/bin/ld: /tmp/ccISkhgJ.o: in function `chars':
st.c:(.text+0x3d3): undefined reference to `TTF_SetFontSize'

The problems are:

  1. The libraries need to go after st.c.
  2. The math library is needed.

I had success compiling using this command:
cc st.c -lSDL2 -lSDL2_ttf -lm -o st

Thank you! Your GRAPHIC-2 simulator was incredibly helpful and a lot of fun. The issue has been fixed via #3.