Heya,
I want to compile a simple Main class using SFML from terminal but I'm getting the no undefined symbols error.
I have put the frame works in the correct places and the include statement isn't giving me any error.
Undefined symbols for architecture x86_64:
"sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)", referenced from:
_main in Main-66feaa.o
"sf::RenderWindow::~RenderWindow()", referenced from:
_main in Main-66feaa.o
"sf::String::String(char const*, std::__1::locale const&)", referenced from:
_main in Main-66feaa.o
"sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
_main in Main-66feaa.o
The main class is:
#include <iostream>
#include <vector>
#include "Mechanics.hpp"
#include <SFML/Graphics.hpp>
int main() {
std::cout << "Hello Elliot" << std::endl;
Mechanics *mech = new Mechanics();
int f = 5;
int m = 10;
double force = (*mech).force(f, m);
std:: cout << force << std::endl;
double vel = (*mech).velocityTime(5, 9.81, 30);
std::cout << vel << std::endl;
sf::RenderWindow window(sf::VideoMode(800, 600), "Pls Wrk");
return 0;
}
g++ version:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
It would be a massive help if anyone could tell how to compile this from terminal,
I'm pretty new to c++.
Thanks,
Rainy