I am supposed to make an audio analysis programme. I have installed QT Creator successfully and I also managed to include SFML library.
Here is what i added to audioPlayer.pro file:
INCLUDEPATH += D:\qt\SFML-2.2\include\SFML
INCLUDEPATH += D:\qt\SFML-2.2\include
LIBS += D:\qt\SFML-2.2\bin\sfml-audio-d-2.dll
mainwidow.cpp:
void MainWindow::on_pushButton_clicked() { QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "C://", tr("Audio files (*.wav)"));
std::string file = fileName.toStdString();
sf::SoundBuffer buffer;
buffer.loadFromFile((file));
sf::Sound sound;
sound.setBuffer(buffer);
sound.play();
}
I believe that here its obvious whatts going on.
So, when i build my project i get 8 errors:
mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Sound::Sound(void)" (__imp_??0Sound@sf@@QAE@XZ) referenced in function "private: void __thiscall MainWindow::on_pushButton_clicked(void)" (?on_pushButton_clicked@MainWindow@@AAEXXZ)
Those others are just the same, so i didnt paste them.
and here the last one:
debug\audioPlayer.exe:-1: error: LNK1120: 7 unresolved externals
So yeah. I have tried to manually include compilers in tools->options->build & run. I set the MinGw compiler. I have followed several tutorials on this site and others too, but I just cant figure it out.
I checked out these two links:
https://github.com/LaurentGomila/SFML/wiki/Tutorial:-Compile-and-Link-SFML-with-Qt-Creator https://github.com/LaurentGomila/SFML/wiki/Tutorial:-Link-SFML-with-Qt-Creator
But no success.