Bonjour,
J'éssaie de compiler le programme suivant:
#include <SFML/Window.hpp>
int main(int argc, char const *argv[])
{
sf::Window window(sf::VideoMode(1000, 1000), "hmdlh");
return 0;
}en utilisant les 2 commandes:
g++ -c main.cpp -o test.o -DSFML_STATIC -I C:\Users\Admin\SFML\include
g++ test.o -L C:\Users\Admin\SFML\lib -l sfml-window-s -l sfml-system-s -lopengl32 -lwinmm -lgdi32 -lfreetype -ljpeg
mais j'ai eu l'erreur:
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -ljpeg
collect2.exe: error: ld returned 1 exit statusJ'ai alors télécharger une bibliothèque appelée
libjpeg de ce site
http://gnuwin32.sourceforge.net/packages/jpeg.htm, j'ai copié le fichier jpeg.lib don mon répertoire lib puis j'ai relancé la 2ème commande. voilà ce qu'on m'affiche:
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Admin\SFML\lib/libsfml-system-s.a(Err.cpp.obj):Err.cpp:(.text+0x3d): undefined reference to `_imp____acrt_iob_func'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Admin\SFML\lib/libsfml-system-s.a(Err.cpp.obj):Err.cpp:(.text+0x9a): undefined reference to `_imp____acrt_iob_func'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Admin\SFML\lib/libsfml-system-s.a(Err.cpp.obj):Err.cpp:(.text+0x113): undefined reference to `_imp____acrt_iob_func'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Admin\SFML\lib/libsfml-system-s.a(Err.cpp.obj):Err.cpp:(.text+0x193): undefined reference to `_imp____acrt_iob_func'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Admin\SFML\lib/libsfml-system-s.a(Err.cpp.obj):Err.cpp:(.text+0x1ee): undefined reference to `_imp____acrt_iob_func'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Admin\SFML\lib/libsfml-system-s.a(Err.cpp.obj):Err.cpp:(.text+0x252): more undefined references to `_imp____acrt_iob_func' follow
collect2.exe: error: ld returned 1 exit status Aidez-moi s'il vous plaît!!