Ubuntu SFML linking problem.

I have installed Codeblocks on my Ubuntu, and it wont work with SFML,
I linked it like the page sfml-dev.org has shown me.

The errors are:

1
2
3
4
5
ld||cannot find -lsfml-graphics-s-d|
ld||cannot find -lsfml-network-s-d|
ld||cannot find -lsfml-system-s-d|
ld||cannot find -lsfml-window-s-d|
||=== Build finished: 4 errors, 0 warnings (0 minutes, 0 seconds) ===|


thanks for help guys :D

Edit: i forgot linking audio, but with doin it, it doesnt work aswell.
Last edited on
Does it work if you remove -s-d?
The Ubuntu SFML package contains shared libraries so you can not link statically.

Try it without "-s" i.e.
-lsfml-graphics-d


Edit: Didn't refresh before posting.

Edit edit: Here you go: http://en.sfml-dev.org/forums/index.php?topic=11092.0
Last edited on
ok, so I deleted the -s and the SFML_STATIC
but it wont work, error: cannot find -lsfml-graphics-d

Edit: in dynamic linking I have to copy some .dll's right?
Last edited on
Have you installed the libsfml-dev package? DLL files are only used on Windows. If you have installed SFML correctly you should not have to move any library files anywhere.

Are you sure you should be using the -d and/or -s suffix on Linux? It's mentioned in the SFML Visual Studio tutorial (http://www.sfml-dev.org/tutorials/2.1/start-vc.php) but I can't see it mentioned anywhere in the SFML Linux tutorial (http://www.sfml-dev.org/tutorials/2.1/start-linux.php).
thanks, if I delete the -d we have another error :D
undefined reference to jpeg_finish_compress@LIBJPEG_6.2
and other undefined reference to ...

Edit: Got the same error as this guy,
http://pastebin.com/5HrvG5be
Edit2: i installed libJPEG6.2, and I got some less errors,
new errors are:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 ||warning: libGLEW.so.1.5, needed by /home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewUniform1fARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__GLEW_ARB_shader_objects'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewGetObjectParameterivARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__GLEW_ARB_vertex_shader'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewFramebufferTexture2DEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewUniformMatrix4fvARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewGenFramebuffersEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewUniform3fARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewRenderbufferStorageEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__GLEW_ARB_fragment_shader'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewActiveTextureARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewShaderSourceARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `glewInit'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewBindFramebufferEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewFramebufferRenderbufferEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewLinkProgramARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewUseProgramObjectARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewBlendFuncSeparateEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewGenRenderbuffersEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewUniform2fARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewUniform4fARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewCreateProgramObjectARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `glewGetErrorString'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewCompileShaderARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewDeleteRenderbuffersEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewDeleteObjectARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewGetUniformLocationARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewGetInfoLogARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__GLEW_EXT_blend_func_separate'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewDeleteFramebuffersEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewCheckFramebufferStatusEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewUniform1iARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__GLEW_ARB_texture_non_power_of_two'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__GLEW_ARB_shading_language_100'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewCreateShaderObjectARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewBindRenderbufferEXT'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__GLEW_EXT_framebuffer_object'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewAttachObjectARB'|
/home/bolbi/bolbi/SFML-2.1/lib/libsfml-graphics.so||undefined reference to `__glewGetHandleARB'|
||=== Build finished: 39 errors, 1 warnings (0 minutes, 4 seconds) ===| 


Edit: ... There is a problem with GLEW, but I dont use GLEW, I just use Codeblocks on ubuntu with sfml, why he says something about GLEW?
Last edited on
SFML graphics uses GLEW. It says it can't find libGLEW.so so I guess that's the problem.

Did you build SFML from source? If so, I guess you already have GLEW installed so maybe you just need to add the compiler flag -lGLEW (and maybe also -lGLU -lGL) to link the GLEW library, but that's just a guess.

If you have downloaded some precompiled library files you might have to manually install the correct version of GLEW that was used when building the library. Building from source might be easier because it's probably not so picky about the exact version.

If you use Ubuntu Trusty or later you can install SFML 2.1 from the package manager. That would be the easiest way because it installs all dependencies you need automatically.
Topic archived. No new replies allowed.