Witam,
Mam Qt z kompilatorem mingw492, pobrałem bibliotekę GCC 4.9.2 MinGW (DW2) - 32-bit SFML.
To jest mój plik pro w projekcie.
TEMPLATE = app
CONFIG += console c++14
CONFIG -= app_bundle
CONFIG -= qt
DEFINES += SFML_STATIC
LIBS += -LC:/SFML2/lib
INCLUDEPATH += C:/SFML2/include
CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-main -lsfml-network -lsfml-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
SOURCES += main.cpp
a to mój plik cpp
#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;
}
Program po uruchomieniu wyświetla tylko okienko cmd, a nie okno biblioteki. Co powoduje, że nie mogę obsługiwać sprzętu tą biblioteką. Nie ma żadnego błędu w kompilacji. Sprawdzałem już wszystko co mi przyszło na myśl.
Spotkał się ktoś z czymś takim?
Pracuję pod win 10.