Bonjour,
J'ai essayé de compiler le code de base avec le petit rond vert sur le tout nouveau SFML 2.2. Alors ça marche en dynamique mais pas en statique.
Je suis sous QtCreator et j'ai pris un MinGW 4.9.2 via ce lien
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/. Configuré i686, posix, dwarf.
Mon .pro en dynamique:
TEMPLATE = app
CONFIG -= console
CONFIG -= app_bundle
CONFIG -= qt
DEFINES += SFML_DYNAMIC
INCLUDEPATH += C:\SFML-2.2\include
LIBS += C:\SFML-2.2\lib\libsfml-graphics.a \
C:\SFML-2.2\lib\libsfml-window.a \
C:\SFML-2.2\lib\libsfml-system.a \
C:\SFML-2.2\lib\libsfml-audio.a \
C:\SFML-2.2\lib\libsfml-network.a
SOURCES += main.cpp
En statique:
TEMPLATE = app
CONFIG -= console
CONFIG -= app_bundle
CONFIG -= qt
DEFINES += SFML_STATIC
INCLUDEPATH += C:\SFML-2.2\include
LIBS += C:\SFML-2.2\lib\libsfml-graphics-s.a \
C:\SFML-2.2\lib\libsfml-window-s.a \
C:\SFML-2.2\lib\libsfml-audio-s.a \
C:\SFML-2.2\lib\libsfml-network-s.a \
C:\SFML-2.2\lib\libsfml-system-s.a \
C:\SFML-2.2\lib\libsndfile.a \
C:\SFML-2.2\lib\libjpeg.a \
C:\SFML-2.2\lib\libfreetype.a \
C:\SFML-2.2\lib\libglew.a \
C:\SFML-2.2\lib\libopenal32.a \
C:\MinGW-4.9.2\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\i686-w64-mingw32\lib\libwinmm.a \
C:\MinGW-4.9.2\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\i686-w64-mingw32\lib\libws2_32.a \
C:\MinGW-4.9.2\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\i686-w64-mingw32\lib\libgdi32.a
SOURCES += main.cpp
Et les erreurs (en statique donc):
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0x341): undefined reference to `glReadPixels@28'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x12f): undefined reference to `glClearColor@16'
Makefile.Release:77: recipe for target 'release\TestSFML2_2_static.exe' failed
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7a8): undefined reference to `glMatrixMode@4'
mingw32-make[1]: Leaving directory 'C:/Programmation C++/Projets Qt Creator/Tests/build-TestSFML2_2_static-Desktop_Qt_5_3_MinGW_32bit-Release'
makefile:34: recipe for target 'release' failed
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7b0): undefined reference to `glPopMatrix@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7bc): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7c4): undefined reference to `glPopMatrix@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7d0): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7d8): undefined reference to `glPopMatrix@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7dd): undefined reference to `glPopClientAttrib@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x97e): undefined reference to `glViewport@16'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x98d): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x9a6): undefined reference to `glLoadMatrixf@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x9b5): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xaf1): undefined reference to `glBlendFunc@8'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xb3f): undefined reference to `glBlendFunc@8'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc1a): undefined reference to `glDisable@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc29): undefined reference to `glDisable@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc38): undefined reference to `glDisable@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc47): undefined reference to `glDisable@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc56): undefined reference to `glEnable@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc65): undefined reference to `glEnable@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc74): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc83): undefined reference to `glEnableClientState@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xc92): undefined reference to `glEnableClientState@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xca1): undefined reference to `glEnableClientState@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xcce): undefined reference to `glLoadMatrixf@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xd81): undefined reference to `glPushClientAttrib@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xd90): undefined reference to `glPushAttrib@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xd9f): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xda7): undefined reference to `glPushMatrix@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xdb3): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xdbb): undefined reference to `glPushMatrix@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xdc7): undefined reference to `glMatrixMode@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xdcf): undefined reference to `glPushMatrix@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xe9d): undefined reference to `glLoadMatrixf@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xec0): undefined reference to `glLoadMatrixf@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xf8a): undefined reference to `glVertexPointer@16'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xfb4): undefined reference to `glColorPointer@16'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0xfde): undefined reference to `glTexCoordPointer@16'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x1004): undefined reference to `glDrawArrays@12'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x144): undefined reference to `glClear@4'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x7e5): undefined reference to `glPopAttrib@0'
C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp:(.text+0x10c3): undefined reference to `glLoadMatrixf@4'
C:/MinGW-4.9.2/i686-4.9.2-posix-dwarf-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: C:\SFML-2.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj): bad reloc address 0x4 in section `.text.startup'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [release\TestSFML2_2_static.exe] Error 1
mingw32-make: *** [release] Error 2
19:58:43: The process "C:\MinGW-4.9.2\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project TestSFML2_2_static (kit: Desktop Qt 5.3 MinGW 32bit)
When executing step 'Make'
J'appelle make via:
C:\MinGW-4.9.2\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\bin
Pouvez-vous m'aider à résoudre ces erreurs? Je ne crois pas avoir oublié de librairies.