私は非常に奇妙な問題に直面しました。私はVLCQtライブラリを使用しており、非常に単純なビデオプレイヤーを正常に実行しています。メインクラスに非常に単純なQlabelを追加したい場合は、この時点でクラッシュしますui-> setupUi(this)。 出力ウィンドウは、これらstatamentが含ま:新しいオブジェクトを宣言した後、Qtアプリケーションがクラッシュする
HEAP [VideoPlayer.exe]:RtlValidateHeap(00000000002F0000、0000000000334220)に指定された無効なアドレス VideoPlayer.exeは、ブレークポイントを引き起こしました。
SimplePlayer.h:
class SimplePlayer : public QMainWindow
{
Q_OBJECT
public:
SimplePlayer(QWidget *parent = 0);
~SimplePlayer();
private:
Ui::SimplePlayer *ui;
VlcInstance *_instance;
VlcMedia *_media;
VlcMediaPlayer *_player;
//QLabel *_lbl;// if I declare a very simple Qlabel the app crashes
private slots:
void openLocal();
void openUrl();
};
SimplePlayer.cpp
SimplePlayer::SimplePlayer(QWidget *parent)
: QMainWindow(parent)
{
ui->setupUi(this);
_instance = new VlcInstance(VlcCommon::args(), this);
_player = new VlcMediaPlayer(_instance);
_player->setVideoWidget(ui->video);
ui->video->setMediaPlayer(_player);
ui->volume->setMediaPlayer(_player);
ui->volume->setVolume(50);
ui->seek->setMediaPlayer(_player);
// _lbl = new QLabel;// if I declare a very simple Qlabel the app crashes
...//connections
}
は、あなたはあなたがよろしいですあなたのコンパイラに正しいバイナリを使用して(そして正しい設定で)?別のコンパイラバージョン用にコンパイルされたバイナリを使用するか、Visual Studioでデバッグとリリースを混在させると、ヒープの破損の問題が発生します。ありがとう。 – drescherjm