OK 그래서 다른 솔루션을 먼저 확인해 보았습니다. 문서에서 곧바로 코드를 따랐지만 두 가지 오류가 있습니다. 파일에 문제가있는 것 같지만 파일이 모두 .hpp 인 경우를 제외하고는 그렇게 생각하지 않습니다. 초보자이므로 놓친 바보 같은 소리 일 수 있습니다.Apple Mach-O 링커 (id) 오류 - 링커 명령이 종료 코드 1과 함께 실패했습니다 (호출을 보려면 -v 사용). C++ SFML
#include <iostream>
#include <SFML/Graphics.hpp>
int main()
{
// create the window
sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
// clear the window with black color
window.clear(sf::Color::Black);
// draw everything here...
// window.draw(...);
// end the current frame
window.display();
}
return 0;
}
구문에 오류가 없으며 일종의 라이브러리 오류 여야합니다.
답변이 업데이트되었습니다. 스택 오버플로의 모든 솔루션이이 특정 문제에 대한 실제 솔루션이 아니기 때문에 여전히 동일한 문제에 직면했을 때 다른 사람을 도울 질문을 던지십시오.