对于我的生活,我无法让scons链接这些SFML库。我相信我遵循了scons网站关于图书馆链接所做的一切,所以我不知道该做什么:
import fnmatch
import os
#Setup environment
file_match = "*.cpp"
#Recursive Glob method to find all source files
matches = []
for root, dirnames, filenames in os.walk("src/"):
for filename in filenames:
if fnmatch.fnmatch(filename, file_match):
matches.append(os.path.join(root, filename))
#Compile the program
env = Environment();
env.Append(LIBS = ["sfml-graphics","sfml-window","sfml-system"]);
env.Append(LIBPATH = "/usr/local/lib");
env.Program(target = "Game", source = matches)
编辑:显然,此代码有效。看来我的电脑需要休息几天才能解决问题。