Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ws6754

Pages: [1]
1
General / Undefined symbols for architecture x86_64?
« on: April 16, 2023, 06:42:42 pm »
I'm just starting out with SFML so I tried running a program with SFML like in the tutorial and tried compiling it with g++ but it keeps saying
Undefined symbols for architecture x86_64:
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
      _main in main-caaa1c.o
  "sf::Window::close()", referenced from:
      _main in main-caaa1c.o
  "sf::Window::pollEvent(sf::Event&)", referenced from:
      _main in main-caaa1c.o
  "sf::Window::Window(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main-caaa1c.o
  "sf::Window::~Window()", referenced from:
      _main in main-caaa1c.o
  "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
      _main in main-caaa1c.o
  "sf::Window::isOpen() const", referenced from:
      _main in main-caaa1c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
here's my code
#include <iostream>
#include <SFML/Window.hpp>
using namespace std;
int main() {
    sf::Window window(sf::VideoMode(800,600), "Window", sf::Style::Close);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }

    cout << endl;
    return 0;
}

Pages: [1]
anything