JuliaMultimedia / SimpleDirectMediaLayer.jl

SDL2
MIT License
81 stars 18 forks source link

TTF_Openfont not found #22

Closed mhinsch closed 6 years ago

mhinsch commented 6 years ago

The included example crashes for both, Julia 0.6.4 and 0.7 beta 2 on the call to TTF_Openfont:

ERROR: LoadError: UndefVarError: TTF_OpenFont not defined
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:576
 [2] include(::String) at ./sysimg.jl:14
 [3] process_options(::Base.JLOptions) at ./client.jl:305
 [4] _start() at ./client.jl:371

libsdl2-ttf and libsdl2-ttf-dev are installed. The platform is ubuntu 16.4.

jonathanBieler commented 6 years ago

Thanks for testing this out, we have been making some changes recently (https://github.com/jonathanBieler/SimpleDirectMediaLayer.jl/pull/20) and it might work better on master (Pkg.checkout) although the tests still fail on linux (installation problems...).

Note there's this issue on v0.6 that might also create problems.

mhinsch commented 6 years ago

With master I don't get a LoadError any more, but now the test program crashes with a segfault on what appears to be this line:

text = SDL2.TTF_RenderText_Blended(font, txt, SDL2.Color(20,20,20,255))

(again the same for 0.6.4 and 0.7 beta 2 (plus a gazillion warnings for the latter of course))

signal (11): Segmentation fault
while loading /home/martin/devel/projects/test/juliasdl/test.jl, in expression starting on line 29
TTF_SizeUTF8 at /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so (unknown line)
TTF_RenderUTF8_Blended at /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so (unknown line)
TTF_RenderText_Blended at /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so (unknown line)
TTF_RenderText_Blended at /home/martin/.julia/v0.6/SimpleDirectMediaLayer/src/lib/SDL_ttf.jl:150
unknown function (ip: 0x7f808bfb6c73)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1903
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:75
eval at /buildworker/worker/package_linux64/build/src/interpreter.c:242
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:543
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:692
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:592
jl_parse_eval_all at /buildworker/worker/package_linux64/build/src/ast.c:873
jl_load at /buildworker/worker/package_linux64/build/src/toplevel.c:616
include_from_node1 at ./loading.jl:576
unknown function (ip: 0x7f809e98fecb)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1903
include at ./sysimg.jl:14
unknown function (ip: 0x7f809e81a4eb)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1903
process_options at ./client.jl:305
_start at ./client.jl:371
unknown function (ip: 0x7f809e99eaf8)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1903
unknown function (ip: 0x401bc8)
unknown function (ip: 0x401612)
__libc_start_main at /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
unknown function (ip: 0x4016bc)
Allocations: 1077108 (Pool: 1076026; Big: 1082); GC: 0
Segmentation fault (core dumped)
mhinsch commented 6 years ago

I've in the meantime upgraded to 18.4 (new computer). Installing master and running tests and examples works without any issues now.

Edit: File this one under great stupidity. It turns out the problem (of example in master crashing) was due to me copying the script into a separate directory which meant that it didn't find the font file any more... So, unless lack of return value checking in the example program is considered a bug please feel free to close this issue.

jonathanBieler commented 6 years ago

Nice, I also made some changes on master to make sure everything installs, so I don't think the issue was useless.