x11-libs/cairo-1.10.2 export glew symbols of an embedded old version of glew leading to problem when linking with external glew and cairo. Patch from debian git and code showing the problem will follow. Reproducible: Always # g++ -W -Wall test.cpp -o test -lSDL -lGLEW -lcairo -lGL -lGLU && ./test and # g++ -W -Wall test.cpp -o test -lSDL -lcairo -lGLEW -lGL -lGLU && ./test are the 2 command lines that should lead to the same result. if the driver supports GL_ARB_viewport_array the bug is exhibited and second compilation display (nil) instead of the correct address. By adding the following patch behavior is back to normal
Created attachment 275425 [details] test.cpp sample code
Created attachment 275427 [details, diff] cairo-1.10.2-export-symbols.patch Patch from debian git http://anonscm.debian.org/gitweb/?p=collab-maint/cairo.git;a=tree;f=debian/patches;h=44d6d0dada5ce64db15331257a1cc0ce9ec68070;hb=HEAD
How about setting $(export_symbol) at the top in an '#else' statement instead? That would probably stand a better chance of being accepted upstream. Thanks
So, it was fixed in the master by removing glew. But the functions use to substitute are only available in the master. The answer probably lies in the bit cryptic content of this commit: http://cgit.freedesktop.org/cairo/commit/configure.ac?id=b101c7dab8cdbf7b9321355a8d2311b2f863f011 Chances are that the solution from comment 2 ain't that bad for 1.10.
What's more, it seems that right now cairo has an automagical dependency on mesa[egl] (as unless opengl-apple provides egl too it the only egl provider (that I know of)).
spatz maintains this now
Applied in 1.10.2-r3. Thanks!