I
I
Ian Smirnovski2019-11-17 10:52:03
Qt
Ian Smirnovski, 2019-11-17 10:52:03

How to connect the OGDF library for graph visualization to QT?

Hello!
I want to visualize a graph in an application written in QT. I found the OGDF library on the Internet, which works with graphs, but there are problems with its connection! Now I've stupidly created a clean project in QT and I'm trying to connect it, but it's still not visible. The library is located in the project file in the /ogdf folder. Here is the project's .pro file:

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS


# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs onlyr up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    main.cpp \
    mainwindow.cpp

HEADERS += \
    mainwindow.h \

FORMS += \
    mainwindow.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

Sources, headers, etc. all standardly created through QT Creator i.e. for now, just at least connect it and pull it through main. Mb someone worked with her? What needs to be added to the pro file so that everything works correctly ??

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vanyamba-electronics, 2019-11-17
@vanyamba-electronics

LIBS += ogdf

I
Ian Smirnovski, 2019-11-18
@smirnovskoe

Here is the structure of the files in the project directory:

--- MyProject
--- --- mainwindow.h
--- --- mainwindow.cpp
--- --- mainwindow.ui
--- --- main.cpp
--- --- MyProject.pro
--- --- MyProject.pro.user

This is a clean project generated in QT Creator that displays an empty window. The .pro file structure is above.
Here is the folder structure with OGDF:
--- ogdf
--- --- cmake
--- --- doc
--- --- include
--- --- --- coin
--- --- --- --- набор папок с хедерами
--- --- --- ogdf
--- --- --- --- набор папок с хедерами
--- --- src
--- --- --- coin
--- --- --- --- набор папок с сорсами
--- --- --- ogdf
--- --- --- --- набор папок с сорсами
--- --- test
--- --- .gitignore
--- --- CMakeLists.txt
--- --- LICENSE.txt
--- --- README.md
--- --- makeMakefile.sh

I put the ogdf c folder in my projects folder:
--- MyProject
--- --- mainwindow.h
--- --- mainwindow.cpp
--- --- mainwindow.ui
--- --- main.cpp
--- --- MyProject.pro
--- --- MyProject.pro.user
--- --- ogdf
--- --- --- (дальше структура как выше описал)

Added LIBS += ogdfwrites there is no such folder or file. Tried stupidly in INCLUDEPATH to score the necessary files. Suppose you need a file (I will give the full path):
c:\qt_projects\MyProject\ogdf\include\ogdf\basic\Graph.h
. Scored in INCLUDEPATH = ogdf/include/ogdf/basic. I main.cpppull #include "Graph.h", he swears that he cannot find the List.hone that lies next to him ( Graph.hthere is a line in it #include <ogdf/basic/List.h>). How to connect it correctly and correctly?
In the examples on off. On their website, they write:
#include <ogdf/basic/graph_generators.h>
#include <ogdf/layered/DfsAcyclicSubgraph.h>
#include <ogdf/fileformats/GraphIO.h>

Tried to set these paths in different ways. All the same or does not see, or does not exist writes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question