Reputation: 10137
Just trying to figure out how to get SFML to work in QT. My include path in the .pro file looks as follows:
#include sfml
INCLUDEPATH += /usr/include/SFML
while my main file has....
#include "mainwindow.h"
#include <QtGui/QApplication>
#include <iostream>
#include <SFML/System.hpp>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWindow;
mainWindow.setOrientation(MainWindow::ScreenOrientationAuto);
mainWindow.showExpanded();
sf::Clock Clock;
while (Clock.GetElapsedTime() < 5.f)
{
std::cout << Clock.GetElapsedTime() << std::endl;
sf::Sleep(0.5f);
}
return app.exec();
}
Yet, all I get is a bunch of undefined references. Why is this?q
Upvotes: 1
Views: 1681
Reputation: 29886
INCLUDEPATH
allow the compiler to find the headers, you need to add the following line to you .pro file to link the library
LIBS += -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio
Upvotes: 1