linux - C++ SFML 2.1 undefined reference to GLEW -
i trying compile this:
#include < sfml/graphics.hpp> int main() { sf::renderwindow window(sf::videomode(200, 200), "sfml works!"); sf::circleshape shape(100.f); shape.setfillcolor(sf::color::green); while (window.isopen()) { sf::event event; while (window.pollevent(event)) { if (event.type == sf::event::closed) window.close(); } window.clear(); window.draw(shape); window.display(); } return 0; }
clang ++ -c main.cpp works!!
clang++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system
gives me fallowing error:
/usr/bin/ld: warning: libglew.so.1.5, needed /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libjpeg.so.62, needed /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so, not found (try using -rpath or -rpath-link) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_finish_compress@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_write_scanlines@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewuniform1farb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_std_error@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glew_arb_shader_objects' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewgetobjectparameterivarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glew_arb_vertex_shader' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewframebuffertexture2dext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewuniformmatrix4fvarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_set_quality@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewgenframebuffersext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewuniform3farb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_set_defaults@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewrenderbufferstorageext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_createcompress@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glew_arb_fragment_shader' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewactivetexturearb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_start_compress@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewshadersourcearb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `glewinit' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewbindframebufferext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewframebufferrenderbufferext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewlinkprogramarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewuseprogramobjectarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewblendfuncseparateext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewgenrenderbuffersext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewuniform2farb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_destroy_compress@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewuniform4farb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewcreateprogramobjectarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `glewgeterrorstring' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewcompileshaderarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewdeleterenderbuffersext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewdeleteobjectarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewgetuniformlocationarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewgetinfologarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glew_ext_blend_func_separate' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewdeleteframebuffersext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewcheckframebufferstatusext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewuniform1iarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glew_arb_texture_non_power_of_two' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `jpeg_stdio_dest@libjpeg_6.2' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glew_arb_shading_language_100' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewcreateshaderobjectarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewbindrenderbufferext' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glew_ext_framebuffer_object' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewattachobjectarb' /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libsfml-graphics.so: undefined reference `__glewgethandlearb' clang: error: linker command failed exit code 1 (use -v see invocation)
as error messages in first 2 lines tell apparently missing libglew
, libjpeg
. need install development packages of each of them (or download, compile, , install them yourself).
the other errors missing functions expected in either of dependency libs.
Comments
Post a Comment