-
-
Save anonymous/0b356a82ec3e9ff71e01 to your computer and use it in GitHub Desktop.
Error with qt and tulip; program builds but dies just after being run. Cannot run long enough to show 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
cmake_minimum_required(VERSION 2.8) | |
PROJECT(MODIB) | |
FIND_PACKAGE(TULIP REQUIRED) | |
FIND_PACKAGE(Qt4 REQUIRED) | |
INCLUDE(${QT_USE_FILE}) | |
SET(MODIB_SOURCES | |
main.cpp #modib.cpp | |
) | |
SET(MODIB_HEADERS | |
modib.h | |
) | |
SET(MOC_HEADERS | |
) | |
SET(UI_FILES | |
#modib.ui | |
) | |
SET(RESOURCE_FILES) | |
SET(QT_USE_QTOPENGL TRUE) | |
STRING(REGEX REPLACE ".*/" "" PLUGIN_NAME ${CMAKE_CURRENT_SOURCE_DIR}) | |
STRING(TOLOWER ${PLUGIN_NAME} PLUGIN_NAME) | |
INCLUDE_DIRECTORIES(${TULIP_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) | |
QT4_WRAP_UI(UI_SRCS ${UI_FILES}) | |
QT4_WRAP_CPP(MOC_SRCS ${MOC_HEADERS}) | |
QT4_ADD_RESOURCES(RCC_SRCS ${RESOURCE_FILES}) | |
#ADD_LIBRARY(${PLUGIN_NAME}-${TULIP_PLUGIN_VERSION} SHARED ${MODIB_SOURCES} ${UI_SRCS} ${MOC_SRCS} ${RCC_SRCS}) | |
ADD_EXECUTABLE(MODIB ${MODIB_SOURCES} ${MOC_SRCS} ${UI_SRCS} ${MODIB_SOURCES} ${RCC_SRCS}) | |
TARGET_LINK_LIBRARIES(MODIB ${TULIP_LIBRARY} ${TULIP_CORE_LIBRARY} ${TULIP_OGL_LIBRARY} ${TULIP_QT4_LIBRARY} ${TULIP_GUI_LIBRARY} ${TULIP_OGDF_LIBRARY} ${TULIP_PYTHON_LIBRARY} ${QT_LIBRARIES}) | |
INSTALL(TARGETS MODIB RUNTIME DESTINATION ${TULIP_PLUGINS_PATH} | |
LIBRARY RUNTIME DESTINATION bin) | |
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
Program received signal SIGSEGV, Segmentation fault. | |
0x00007ffff46c2f77 in FTSize::CharSize(FT_FaceRec_**, unsigned int, unsigned int, unsigned int) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libftgl.so | |
(gdb) where | |
#0 0x00007ffff46c2f77 in FTSize::CharSize(FT_FaceRec_**, unsigned int, unsigned int, unsigned int) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libftgl.so | |
#1 0x00007ffff46c2128 in FTFace::Size(unsigned int, unsigned int) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libftgl.so | |
#2 0x00007ffff46c75b7 in FTFontImpl::FaceSize(unsigned int, unsigned int) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libftgl.so | |
#3 0x00007ffff766fe41 in tlp::GlLabel::init() () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.so | |
#4 0x00007ffff7674994 in tlp::GlLabel::GlLabel() () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.so | |
#5 0x00007ffff7680735 in tlp::GlNode::GlNode(unsigned int) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.so | |
#6 0x00007ffff7651bdd in tlp::GlGraphRenderer::visitNodes(tlp::Graph*, tlp::GlSceneVisitor*, bool) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.so | |
#7 0x00007ffff7651cad in tlp::GlGraphRenderer::visitGraph(tlp::GlSceneVisitor*, bool) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.---Type <return> to continue, or q <return> to quit--- | |
so | |
#8 0x00007ffff7650b60 in tlp::GlGraphComposite::acceptVisitor(tlp::GlSceneVisitor*) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.so | |
#9 0x00007ffff762762b in tlp::GlComposite::acceptVisitor(tlp::GlSceneVisitor*) | |
() | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.so | |
#10 0x00007ffff769730e in tlp::GlScene::draw() () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-ogl-4.3.so | |
#11 0x00007ffff7201705 in tlp::GlMainWidget::render(QFlags<tlp::GlMainWidget::RenderingOption>, bool) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-gui-4.3.so | |
#12 0x00007ffff7201797 in tlp::GlMainWidget::draw(bool) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-gui-4.3.so | |
#13 0x00007ffff7201865 in tlp::GlMainWidget::paintEvent(QPaintEvent*) () | |
from /home/XXX/tulip-build/tulip-build-release/install/lib/libtulip-gui-4.3.so | |
#14 0x00007ffff65eea3e in QWidget::event(QEvent*) () | |
---Type <return> to continue, or q <return> to quit--- | |
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#15 0x00007ffff3c85c68 in QGLWidget::event(QEvent*) () | |
from /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4 | |
#16 0x00007ffff65a18ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) | |
() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#17 0x00007ffff65a425b in QApplication::notify(QObject*, QEvent*) () | |
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#18 0x00007ffff607763e in QCoreApplication::notifyInternal(QObject*, QEvent*) | |
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 | |
#19 0x00007ffff65f36b4 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () | |
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#20 0x00007ffff67b6f9c in QWidgetPrivate::repaint_sys(QRegion const&) () | |
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#21 0x00007ffff65e2004 in QWidgetPrivate::syncBackingStore() () | |
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#22 0x00007ffff65eeee4 in QWidget::event(QEvent*) () | |
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#23 0x00007ffff3c85c68 in QGLWidget::event(QEvent*) () | |
from /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4 | |
#24 0x00007ffff65a18ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) | |
() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#25 0x00007ffff65a425b in QApplication::notify(QObject*, QEvent*) () | |
---Type <return> to continue, or q <return> to quit--- | |
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#26 0x00007ffff607763e in QCoreApplication::notifyInternal(QObject*, QEvent*) | |
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 | |
#27 0x00007ffff607b171 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 | |
#28 0x00007ffff60a5e83 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 | |
#29 0x00007ffff2b97f05 in g_main_context_dispatch () | |
from /lib/x86_64-linux-gnu/libglib-2.0.so.0 | |
#30 0x00007ffff2b98248 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 | |
#31 0x00007ffff2b98304 in g_main_context_iteration () | |
from /lib/x86_64-linux-gnu/libglib-2.0.so.0 | |
#32 0x00007ffff60a6016 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 | |
#33 0x00007ffff66471ae in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 | |
#34 0x00007ffff607b56f in QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 | |
#35 0x0000000000401272 in main () | |
(gdb) |
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 <tulip/TlpQtTools.h> | |
#include <tulip/GlMainWidget.h> | |
#include <tulip/MouseInteractors.h> | |
#include <QApplication> | |
using namespace tlp; | |
int main(int argc, char** argv) { | |
/* | |
A QApplication must always be declared at the beginning of the main function in order for Tulip to work. | |
This must be done before calling tlp::initTulipSoftware() | |
*/ | |
QApplication app(argc,argv); | |
/* | |
Initialize the library, load plugins and set application runtime pathes accordingly to the host operating system | |
This method should always be called if you intend to use plugins in your application. | |
*/ | |
tlp::initTulipSoftware(NULL); | |
/* | |
Load the file passed as first argument into a graph. | |
This method will select the default Tulip algorithm plugin (TLP) | |
*/ | |
Graph* g = tlp::loadGraph(argv[1]); | |
// Creates the main widget that will display our graph | |
GlMainWidget* mainWidget = new GlMainWidget(NULL); | |
// Adds a layer to the scene | |
GlLayer* mainLayer = mainWidget->getScene()->createLayer("Main"); | |
// Adds the graph to this layer | |
mainLayer->addGraph(g,"graph"); | |
// Display the widget | |
mainWidget->show(); | |
// Flush event loop in order to let paint events pass through in order for the scene to be initialized. | |
QApplication::processEvents(); | |
// Center the camera and draw the graph | |
mainWidget->centerScene(); | |
mainWidget->draw(); | |
// Adds Zoom and pan navigation to the widget | |
mainWidget->installEventFilter(new MouseNKeysNavigator); | |
return app.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment