Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
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
--- ogdf
--- --- cmake
--- --- doc
--- --- include
--- --- --- coin
--- --- --- --- набор папок с хедерами
--- --- --- ogdf
--- --- --- --- набор папок с хедерами
--- --- src
--- --- --- coin
--- --- --- --- набор папок с сорсами
--- --- --- ogdf
--- --- --- --- набор папок с сорсами
--- --- test
--- --- .gitignore
--- --- CMakeLists.txt
--- --- LICENSE.txt
--- --- README.md
--- --- makeMakefile.sh
--- MyProject
--- --- mainwindow.h
--- --- mainwindow.cpp
--- --- mainwindow.ui
--- --- main.cpp
--- --- MyProject.pro
--- --- MyProject.pro.user
--- --- ogdf
--- --- --- (дальше структура как выше описал)
LIBS += ogdf
writes 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.cpp
pull #include "Graph.h"
, he swears that he cannot find the List.h
one that lies next to him ( Graph.h
there is a line in it #include <ogdf/basic/List.h>
). How to connect it correctly and correctly? #include <ogdf/basic/graph_generators.h>
#include <ogdf/layered/DfsAcyclicSubgraph.h>
#include <ogdf/fileformats/GraphIO.h>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question