I configured Codeblocks as well:
https://www.sfml-dev.org/tutorials/2.4/start-cb.phpWhen I compile example program
#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;
}
There are some errors: ------------- Build: Debug in testik (compiler: GNU GCC Compiler)---------------
>
g++ -L/home/znyk/SFML-2.4.2/lib -o bin/Debug/testik obj/Debug/tescik.o /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a /home/znyk/SFML-2.4.2/lib/libsfml-audio-s-d.a /home/znyk/SFML-2.4.2/lib/libsfml-network-s-d.a /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a /home/znyk/SFML-2.4.2/lib/libsfml-system-s-d.a
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(Color.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZN2sf5Color5BlackE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(RenderStates.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZN2sf12RenderStates7DefaultE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(RenderTarget.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(RenderWindow.cpp.o): relocation R_X86_64_32S against hidden symbol `_ZTVN2sf12RenderWindowE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(Shader.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(Texture.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(TextureSaver.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(Transform.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZN2sf9Transform8IdentityE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(GLLoader.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(Shape.cpp.o): relocation R_X86_64_32S against hidden symbol `_ZTVN2sf5ShapeE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(CircleShape.cpp.o): relocation R_X86_64_32S against hidden symbol `_ZTVN2sf11CircleShapeE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(VertexArray.cpp.o): relocation R_X86_64_32S against hidden symbol `_ZTVN2sf11VertexArrayE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(BlendMode.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZN2sf10BlendAlphaE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(GLCheck.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(GLExtensions.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(Image.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(ImageLoader.cpp.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-graphics-s-d.a(Transformable.cpp.o): relocation R_X86_64_32S against hidden symbol `_ZTVN2sf13TransformableE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(Context.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(GlContext.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(GlResource.cpp.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(VideoMode.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(Window.cpp.o): relocation R_X86_64_32S against hidden symbol `_ZTVN2sf6WindowE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(WindowImpl.cpp.o): relocation R_X86_64_32S against hidden symbol `_ZTVN2sf4priv10WindowImplE' can not be used when making a shared object
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(VideoModeImpl.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(WindowImplX11.cpp.o): relocation R_X86_64_32 against undefined symbol `__pthread_key_create' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(GlxContext.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(GlxExtensions.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(JoystickManager.cpp.o): relocation R_X86_64_32 against undefined symbol `__pthread_key_create' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(SensorManager.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(Display.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(JoystickImpl.cpp.o): relocation R_X86_64_32 against undefined symbol `__pthread_key_create' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-window-s-d.a(Joystick.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-system-s-d.a(Err.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-system-s-d.a(Lock.cpp.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-system-s-d.a(Mutex.cpp.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-system-s-d.a(String.cpp.o): relocation R_X86_64_32 against undefined symbol `__pthread_key_create' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-system-s-d.a(ThreadLocal.cpp.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/znyk/SFML-2.4.2/lib/libsfml-system-s-d.a(Time.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZN2sf4Time4ZeroE' can not be used when making a shared object
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
HELP.