我正在尝试在CodeBlocks 16.01版上运行SFML项目。我使用link中的SFML 2.4.2 (GCC 4.9.2 TDM (SJLJ) - 32-bit)
。我的操作系统是Windows 10 64位。我将提取的SFML文件夹放到C:\SFML-2.4.2\
在项目构建选项中,这是我使用的设置:
Search Directories -> Compiler
C:\SFML-2.4.2\include
Search Directories -> Linker
C:\SFML-2.4.2\lib
对于链接器设置选项卡上的调试选项,我将其放在链接库中:
sfml-graphics-d
sfml-window-d
sfml-system-d
对于链接器设置选项卡上的发布选项,我将其放在链接库中:
sfml-graphics
sfml-window
sfml-system
之后,当我尝试运行此代码时:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
我收到了这个错误:
||=== Build: Release in NewSFML (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lsfml-graphics|
ld.exe||cannot find -lsfml-window|
ld.exe||cannot find -lsfml-system|
||error: ld returned 1 exit status|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
任何人都知道我的设置有什么问题?