Hi,
I have Qt with mingw492 compiler. I downloaded GCC 4.9.2 MinGW (DW2) - 32-bit SFML.
This is my *.pro file
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
LIBS += -LD:\Programmin\DTW\SFML2\lib
CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-main -lsfml-network -clsfml-window -lsfml-system
CONFIG(debug, debug|release): LIBS += -lsfml-audio-d -lsfml-graphics-d -lsfml-main-d -lsfml-network-d -lsfml-window-d -lsfml-system-d
INCLUDEPATH += D:\Programmin\DTW\SFML2\include
DEPENDPATH += D:\Programmin\DTW\SFML2\include
SOURCES += main.cpp
and this is my c++ code
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
using namespace std;
int main(int argc, char *argv[])
{
sf::RenderWindow Window(sf::VideoMode(640, 480, 32), "Recording Sounds");
if(!sf::SoundBufferRecorder::isAvailable()){
cout << "something went wrong" << endl;
}
sf::SoundBufferRecorder recorder;
sf::SoundBuffer buffer;
sf::Sound sound;
while(Window.isOpen()){
sf::Event Event;
while(Window.pollEvent(Event)){
switch(Event.type){
case sf::Event::Closed:
Window.close();
break;
case sf::Event::KeyPressed:
if(Event.key.code == sf::Keyboard::R){
recorder.start();
}
else if(Event.key.code == sf::Keyboard::S){
recorder.stop();
buffer = recorder.getBuffer();
sound.setBuffer(buffer);
sound.play();
}
}
}
Window.clear(sf::Color(0, 240, 255));
Window.display();
}
getchar();
return 0;
}
If I run my project I have only cmd window. My qt doesn't appear SFML window and I don't know what I should to do. I work on Windows 10.
Anybody can help me what I did wrong?
I will appreciate your help.