Issue with GR_GL_GetIntegerv in the SDL example

140 views
Skip to first unread message

Alexander Vestin

unread,
Jan 28, 2020, 12:53:53 PM1/28/20
to skia-discuss
Hi,

I'm trying to run the skia SDL example, using an existing opengl context.
However when I try to compile the example I get the following error:
/usr/bin/ld: /tmp/ccHkF2it.o: in function `main':
/home/alex/node-gles/binding/test_skia.cc:198: undefined reference to `
gLogCallsGL'
/usr/bin/ld: /home/alex/folder/binding/test_skia.cc:198: undefined reference to `gCheckErrorGL'

/usr/bin/ld: /home/alex/folder/binding/test_skia.cc:198: undefined reference to `GrGLCheckErr(GrGLInterface const*, char const*, char const*)'
collect2: error: ld returned 1 exit status

I narrowed it down to this line , setting the buffer to 0 and commenting out that line works for it to the draw to the screen this case, but I'm wondering if there are any flags or something I am missing to provide to the compiler or in the build process?

I built skia with
gclient config --unmanaged https://skia.googlesource.com/skia.git
gclient sync
cd skia
mkdir -p out
gn gen out/Debug --args="is_official_build=true is_component_build=true"
ninja -C out/Debug

on Manjaro linux, and compiled using
g++ -std=c++17 -Wall -ggdb3 -g -lSDL2 -ldng_sdk -lexpat -lharfbuzz -ljpeg -lskia -lpng -ljpeg -lpathkit -lpng -lskresources -lsksg -lskshaper -lGL -I/path/to/include -L/path/to/libs test_skia.cc -o main.out

I sort of just threw flags on there to try and find the missing references, but most of them are probably not needed. Anyone seeing what's going wrong here?

Regards,
Alex



Brian Salomon

unread,
Jan 28, 2020, 1:20:27 PM1/28/20
to skia-d...@googlegroups.com
I think the problem is that GR_GL_GetIntegerv is a macro that expands to code that references a global (in debug builds). The global is not exported as part of the shared library. So when it's expanded in test_skia.cc it can't be found by the linker.

In general you shouldn't expect anything you #include from src/ to work in a shared library build for similar reasons. We consider the header files under src/ to be "private" and aren't meant to be used by clients.

Brian

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/4ea3b1d9-3e55-41aa-ba0f-8e86a7a5081a%40googlegroups.com.

Alexander Vestin

unread,
Jan 28, 2020, 1:34:13 PM1/28/20
to skia-discuss
That makes sense, thanks for the swift response!

Alex
To unsubscribe from this group and stop receiving emails from it, send an email to skia-d...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages