我想建立一个简单的项目:
////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
#define SFML_DYNAMIC
////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
// Create the main window
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
// Start main loop
bool Running = true;
while (Running)
{
App.Display();
}
return EXIT_SUCCESS;
}
我用: g++ main.cpp -I./include -L./lib -o main -lsfml-system -lsfml-window -static-libgcc 构建它。一切编译都没有错误,但是当我运行它时:
我尝试构建: -lopengl32 -lglu3s 没有 -static-libgcc 和 #SFML_DYNAMICS 很多组合,但我得到相同的结果:黑色命令窗口而不是带有图形的普通窗口。我使用 SFML 1.6 和 gcc 4.5.2(我在 3... 版本上有同样的问题:/)有人知道我做错了什么吗?或者如何编译?我知道我可以尝试 Visual Studio,但我想用 gcc 来做。