i'm trying compile i've fetched off of github gcc
:
users-mbp:chip-8-emulator user$ gcc -o chip8 chip8.c undefined symbols architecture x86_64: "_sdl_delay", referenced from: _chip8_draw in chip8-bc89fc.o "_sdl_flip", referenced from: _chip8_draw in chip8-bc89fc.o "_sdl_getkeystate", referenced from: _chip8_execute in chip8-bc89fc.o _chip8_prec in chip8-bc89fc.o "_sdl_getvideosurface", referenced from: _chip8_draw in chip8-bc89fc.o "_sdl_init", referenced from: _chip8_prepare in chip8-bc89fc.o "_sdl_locksurface", referenced from: _chip8_draw in chip8-bc89fc.o "_sdl_pollevent", referenced from: _chip8_prepare in chip8-bc89fc.o _chip8_prec in chip8-bc89fc.o "_sdl_setvideomode", referenced from: _chip8_prepare in chip8-bc89fc.o "_sdl_unlocksurface", referenced from: _chip8_draw in chip8-bc89fc.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation)
the error seems issue sdl
library in case, i've had exact same issue several other little projects treid compile. before compiling, installed sdl
libs , checked there:
users-mbp:chip-8-emulator user$ ls /usr/local/lib/ ... libsdl-1.2.0.dylib libsdl.a libsdl.dylib libsdlmain.a ...
after lots of googling seems i'm not 1 problem , couldn't find solution worked. seems osx
doesn't include /use/local/lib
in default linker paths.
how can fix (a permanent solution welcome)?
edit following suggestion user alex tried $ gcc -o chip8 -l/usr/local/lib chip8.c
. error , output identical above.
you'll want add -l/usr/local/lib -lsdl
gcc invocation.
as more permanent solution, convention of os x, , strictly speaking /usr/local/lib
non-standard installation location.
Comments
Post a Comment