我可以将这些g ++调用合并为一个吗?

时间:2013-10-08 14:36:54

标签: c++ g++ command-line-interface

g++ -I include/ -I include/gliese/ -I include/othello/ -c src/OthelloHeuristics.cpp -o obj/Debug/src/OthelloHeuristics.o
g++ -I include/ -I include/gliese/ -I include/othello/ -c src/OthelloNegamaxSearch.cpp -o obj/Debug/src/OthelloNegamaxSearch.o
g++ -I include/ -I include/gliese/ -I include/othello/ -c src/main.cpp -o obj/Debug/src/main.o
g++ -L lib -l othello -l SDL_image -l SDL_ttf -l SDL obj/Debug/src/main.o obj/Debug/src/OthelloHeuristics.o obj/Debug/src/OthelloNegamaxSearch.o -o bin/Debug/othello

目前我正在运行这些线路以构建游戏,并且它可以正常运行。但无论如何将它们合并为一个? (为了获得一些速度)。谢谢!

1 个答案:

答案 0 :(得分:0)

你可以这样写

g++ -I include/gliese/ -c src/OthelloHeuristics.cpp src/OthelloNegamaxSearch.cpp  src/main.cpp 

g++ -L lib -l othello -l SDL_image -l SDL_ttf -l SDL obj/Debug/src/*.o -o bin/Debug/othello