Created
March 20, 2015 23:37
-
-
Save tomalexander/34d0f04a5a67a8e3a27c to your computer and use it in GitHub Desktop.
Minimum for segfault on linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtWidgets/QApplication> | |
#include "main_window.h" | |
#include <string> | |
#include <iostream> | |
int main(int argc, char **argv) | |
{ | |
QApplication app (argc, argv); | |
main_window window; | |
window.setWindowFlags(Qt::Window); // spawn its own window | |
window.show(); | |
try { | |
return app.exec(); | |
} catch(const std::string & e) { | |
std::cerr << "EXCEPTION: " << e << "\n"; | |
return 1; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "main_window.h" | |
#include <QCamera> | |
#include <QWebView> | |
main_window::main_window(QWidget* parent): | |
QWidget(parent) | |
{ | |
QWebView* view = new QWebView(this); | |
QCamera* camera = new QCamera(this); | |
} | |
main_window::~main_window() | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <QtWidgets/QWidget> | |
#include <string> | |
class main_window : public QWidget | |
{ | |
Q_OBJECT | |
public: | |
explicit main_window(QWidget* parent = nullptr); | |
virtual ~main_window(); | |
private: | |
signals: | |
public slots: | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEMPLATE = app | |
TARGET = segfault | |
CONFIG += c++14 | |
CONFIG += console | |
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9 | |
QT += multimedia multimediawidgets core gui widgets network webkit webkitwidgets | |
macx { | |
LIBS += -liconv | |
} | |
HEADERS = \ | |
src/main_window.h \ | |
SOURCES = \ | |
src/main.cpp \ | |
src/main_window.cpp \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Segfault:
backtrace: