Salut, j'ai besoin de votre aide les amis s'il vous plait
Je travail sur un projet C++ avec sfml, je suis sur imac (mojave 10.14.6). Avec xcode le programme compile et la fenêtre se lance sans problème, mais je ne réussi pas avec le makefile, sachant que sur windows, j'arrive a la faire fonctionner
voici une partie du makefile
CC=g++-9
EXE=Bibi.app
FLAGS=-DDEBUG -DPROD -O3 -g -W -Wall -Werror -pedantic -ansi -Wno-deprecated -std=c++14
OBJS=Macros.o
LIBSFM=-I/usr/local/include -L/usr/local/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network
$(EXE): main.o $(OBJS)
$(CC) main.o $(OBJS) -o _Exek/$(EXE) $(FLAGS) $(LIBSFM)
Macros.o: Crvel/Helpers/Macros.hpp
$(CC) -c Crvel/Helpers/Macros.cpp $(FLAGS) $(LIBSFM)
main.o: main.cpp ManiFest.hpp Crvel/Helpers/Macros.hpp
$(CC) -c main.cpp $(FLAGS) $(LIBSFM)
à la sortie cela donne avec g++-9 :
g++-9 -c main.cpp -DDEBUG -DPROD -DOZ -O3 -g -W -Wall -Werror -pedantic -ansi -Wno-deprecated -lpthread -std=c++14 -I/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/include -L/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network
g++-9 -c Crvel/Helpers/Macros.cpp -DDEBUG -DPROD -DOZ -O3 -g -W -Wall -Werror -pedantic -ansi -Wno-deprecated -lpthread -std=c++14 -I/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/include -L/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network
g++-9 main.o Macros.o -o _Exek/Bibi.app -DDEBUG -DPROD -DOZ -O3 -g -W -Wall -Werror -pedantic -ansi -Wno-deprecated -lpthread -std=c++14 -I/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/include -L/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network
Undefined symbols for architecture x86_64:
"sf::Font::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
_main in main.o
"sf::Image::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
_main in main.o
"sf::Music::openFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
_main in main.o
"sf::String::String(char const*, std::locale const&)", referenced from:
_main in main.o
"sf::Texture::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sf::Rect<int> const&)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [Bibi.app] Error 1
et avec clang++ :
clang++ -c main.cpp -DDEBUG -DPROD -DOZ -O3 -g -W -Wall -Werror -pedantic -ansi -Wno-deprecated -lpthread -std=c++14 -I/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/include -L/Users/euraku/Documents/Tps/Prog/LeC++/__Tps/_SfmlBaz/SFM/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network
clang: error: -lpthread: 'linker' input unused [-Werror,-Wunused-command-line-argument]
clang: error: -lsfml-graphics: 'linker' input unused [-Werror,-Wunused-command-line-argument]
clang: error: -lsfml-window: 'linker' input unused [-Werror,-Wunused-command-line-argument]
clang: error: -lsfml-system: 'linker' input unused [-Werror,-Wunused-command-line-argument]
clang: error: -lsfml-audio: 'linker' input unused [-Werror,-Wunused-command-line-argument]
clang: error: -lsfml-network: 'linker' input unused [-Werror,-Wunused-command-line-argument]
make: *** [main.o] Error 1
Merci d'avance et excellente journée