Excuse me, if I wrong.
Does it normal, that static linkage goes without errors only with "-s-d" libs?
When I'm trying to statically link with "-s" the tons of errors comes to build log:
-- Configuring done
-- Generating done
-- Build files have been written to: D:/untitled2
Linking CXX executable untitled.exe
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x12b): undefined reference to `glDeleteTextures@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x192): undefined reference to `__GLEW_ARB_texture_non_power_of_two'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1c5): undefined reference to `__GLEW_ARB_texture_non_power_of_two'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1fd): undefined reference to `glGetIntegerv@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x44c): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x499): undefined reference to `glTexImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x4c4): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x4ef): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x515): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x53b): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x60f): undefined reference to `glGenTextures@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x74c): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x777): undefined reference to `glGetTexImage@20'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x8e3): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x911): undefined reference to `glGetTexImage@20'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x9f4): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xa3a): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xb3f): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xb86): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xcac): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xcf2): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xea9): undefined reference to `glFlush@0'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xeeb): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xf40): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xf53): undefined reference to `glFlush@0'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x12bc): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1300): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x140d): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x145e): undefined reference to `glCopyTexSubImage2D@32'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x156d): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x15bc): undefined reference to `glCopyTexSubImage2D@32'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x16be): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x16e4): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x170a): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x178e): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x17b9): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x17e4): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x184a): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1859): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1861): undefined reference to `glLoadIdentity@0'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x186d): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x188c): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x193f): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x194d): undefined reference to `glLoadMatrixf@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x195c): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x19ba): undefined reference to `glGetIntegerv@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1b72): undefined reference to `glDeleteTextures@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1cb4): undefined reference to `__GLEW_ARB_texture_non_power_of_two'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bin/ld.exe: D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj): bad reloc address 0x17 in section `.text.unlikely'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\untitled.dir\build.make:88: recipe for target 'untitled.exe' failed
CMakeFiles\Makefile2:62: recipe for target 'CMakeFiles/untitled.dir/all' failed
Makefile:74: recipe for target 'all' failed
mingw32-make[2]: *** [untitled.exe] Error 1
mingw32-make[1]: *** [CMakeFiles/untitled.dir/all] Error 2
mingw32-make: *** [all] Error 2
CMake file:
project(untitled)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
SET( CMAKE_CXX_FLAGS "-DSFML_STATIC" )
SET( CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static" )
target_link_libraries(untitled sfml-graphics-s sfml-window-s sfml-system-s)
Source:
#include <SFML/Graphics.hpp>
int main()
{
sf::Texture b;
return 0;
}