Git Product home page Git Product logo

Comments (12)

exzombie avatar exzombie commented on July 20, 2024 1

O dear, thanks for reminding me of this issue! I finally sat down and built a test app using qmake for the first time; I only ever used cmake for QArv apps. Here's what worked for me:

CONFIG += c++14 link_pkgconfig
QT += widgets network
PKGCONFIG += qarv-3 glib-2.0 opencv4

SOURCES = src/main.cpp

The test main.cpp was a copy of the one in QArv. Note the link_pkgconfig option, turns out it's important ☺ . Please confirm it works for you, @robotwhispering and @FCollaPi , then I'll add it to the documentation.

from qarv.

exzombie avatar exzombie commented on July 20, 2024

Ugh, I have forgotten how much hassle it is installing *-dev packages on Ubuntu πŸ˜’ . But I got QArv built on 18.04 with no further issues. Changing INCLUDEPATH should not be necessary, and doing so (as you've shown) messes up the order if includes, causing conflicts with glib's and Qt's use of the word signal.

Are you sure that gio/gio.h is present on your system? The entire path is /usr/include/glib-2.0/gio/gio.h. Also, if QArv has trouble finding gio, where did you obtain Aravis? Aravis too needs gio to compile.

from qarv.

FCollaPi avatar FCollaPi commented on July 20, 2024

I really have forgotten installing Aravis. Does it need a global install or can I just use make under the project folder?

from qarv.

exzombie avatar exzombie commented on July 20, 2024

If you don't want to install Aravis to /usr/local as is the default, you can install it to any prefix, but you will then need to set PKG_CONFIG_PATH properly when running cmake for QArv. And possibly LD_LIBRARY_PATH when you run QArv.

For testing in my Kubuntu VM, I installed Aravis to /usr/local and had no further issues. Just don't use the latest release because it needs meson to build, and the one in 18.04 is too old. I used the latest release in the 0.5 series. Browsing the camera features will probably be slow because only the latest Aravis implements proper value caching, but you will need to update the distro for that.

from qarv.

EmmanuelP avatar EmmanuelP commented on July 20, 2024

Hi,

Just don't use the latest release because it needs meson to build,

I have not tried by myself, but you may probably use pip in order to get the latest release of meson:

pip3 install --user meson

I used the latest release in the 0.5 series.

I guess you meant the latest release in the 0.6 series.

from qarv.

exzombie avatar exzombie commented on July 20, 2024

I used the latest release in the 0.5 series.

I guess you meant the latest release in the 0.6 series.

No, I did use 0.5. I thought that 0.6 requires meson as well, but didn't bother to check because I was running out of time, so I went for the one I knew will work. (I rarely build Aravis myself, only when I need to hack on it, I use packages otherwise)

But if meson is that easy to upgrade, it is definitely better to go for the latest Aravis.

from qarv.

EmmanuelP avatar EmmanuelP commented on July 20, 2024

No, I did use 0.5. I thought that 0.6 requires meson as well, but didn't bother to check because I was running out of time, so I went for the one I knew will work. (I rarely build Aravis myself, only when I need to hack on it, I use packages otherwise)

0.6.x is the latest stable series of aravis. There should be no API or ABI break between each release, which is not the case between unstable releases. 0.6.x releases still rely on autotools.

from qarv.

robotaiguy avatar robotaiguy commented on July 20, 2024

I'm having the same problem @FCollaPi , @EmmanuelP , @exzombie , @alajovic and . I am also building a QT project from scratch, trying to utilize the API. I get the same errors for gdbusintrospection.h as FCollaPi.

If I use the prebuilt QArv project, it runs fine. However, when I followed the main() build suggestion in qarvgui.h, I get those errors. It seems that the gio/gio.h workaround isn't working.

I added PKGCONFIG += aravis-0.6 to my .pro file, and included the qarv-3 library and include paths.
I am using aravis-0.6 stable release, so was able to install it with just ./configure then make then make install

from qarv.

robotaiguy avatar robotaiguy commented on July 20, 2024

@exzombie I already had link_pkgconfig set up. However, I was using the default c++11 settings. After I changed to 14, that error, and others, went away. I'm a bit embarrassed that I didn't see that already.

from qarv.

exzombie avatar exzombie commented on July 20, 2024

Are you sure? Because it works for me if I remove c++14 (main.cpp doesn't use any of those features), but it doesn't work without link_pkgconfig, saying it cannot find gio/gio.h πŸ€” . I'd like to have this cleared up so that I don't post useless instructions. For the record, I have gcc version 9.3.0.

from qarv.

robotaiguy avatar robotaiguy commented on July 20, 2024

@exzombie I cannot be certain which change I made that actually resolved the issue. I got angry with my code, deleted everything, and started over from scratch again. I formed it like you suggested, so you're probably correct. I probably did not have the pkg linked correctly.

Here is my pro file (although, now I'm getting different errors related to "multiple definition of 'qt_plugin_query_metadata" in the moc_decoded files, and "undefined reference to "qt_static_plugin_xxxxxxxx" in the bayer.cpp file. But i should probably form this in a separate question to you, unless you might be able to reach out to me about it. If you see something that jumps out at you, can you email me at [email protected] please or message me directly through github?

QMAKE_PROJECT_NAME = "Detector"

VERSION = 1
DEFINES += VERSION_NUM=\"$${VERSION}\"

QT += core gui widgets network svg concurrent

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++14 link_pkgconfig

PKGCONFIG += qarv-3 glib-2.0 opencv aravis-0.6 gio-2.0 libswscale libavcodec libavutil

SOURCES +=
src/Calib.cpp
src/DarkHelp.cpp
src/Yolo.cpp
src/api/globals.cpp
src/api/qarvcamera.cpp
src/api/qarvcameradelegate.cpp
src/api/qarvdecoder.cpp
src/api/qarvfeaturetree.cpp
src/api/qarvgui.cpp
src/api/qarvrecordedvideo.cpp
src/api/qarvtype.cpp
src/decoders/bayer.cpp
src/decoders/graymap.cpp
src/decoders/mono12packed.cpp
src/decoders/monounpackeddecoders.cpp
src/decoders/swscaledecoder.cpp
src/filters/filter.cpp
src/filters/levels.cpp
src/glvideowidget.cpp
src/main.cpp
src/mainwindow.cpp
src/recorders/gstrecorder_implementation.cpp
src/recorders/gstrecorders.cpp
src/recorders/imagerecorder.cpp
src/recorders/rawrecorders.cpp
src/recorders/recorder.cpp
src/workthread.cpp

HEADERS +=
src/Calib.hpp
src/DarkHelp.hpp
src/Yolo.hpp
src/api/globals.h
src/api/qarvcamera.h
src/api/qarvcameradelegate.h
src/api/qarvdecoder.h
src/api/qarvfeaturetree.h
src/api/qarvgui.h
src/api/qarvrecordedvideo.h
src/api/qarvtype.h
src/decoders/bayer.h
src/decoders/bayer/BayerBG10.h
src/decoders/bayer/BayerBG12.h
src/decoders/bayer/BayerBG12_PACKED.h
src/decoders/bayer/BayerBG16.h
src/decoders/bayer/BayerBG8.h
src/decoders/bayer/BayerGB10.h
src/decoders/bayer/BayerGB12.h
src/decoders/bayer/BayerGB12_PACKED.h
src/decoders/bayer/BayerGB16.h
src/decoders/bayer/BayerGB8.h
src/decoders/bayer/BayerGR10.h
src/decoders/bayer/BayerGR12.h
src/decoders/bayer/BayerGR12_PACKED.h
src/decoders/bayer/BayerGR16.h
src/decoders/bayer/BayerGR8.h
src/decoders/bayer/BayerRG10.h
src/decoders/bayer/BayerRG12.h
src/decoders/bayer/BayerRG12_PACKED.h
src/decoders/bayer/BayerRG16.h
src/decoders/bayer/BayerRG8.h
src/decoders/bayer/decoder.h
src/decoders/graymap.h
src/decoders/mono12packed.h
src/decoders/monounpacked.h
src/decoders/monounpackeddecoders.h
src/decoders/monounpackeddecoders/Mono10Format.h
src/decoders/monounpackeddecoders/Mono12Format.h
src/decoders/monounpackeddecoders/Mono14Format.h
src/decoders/monounpackeddecoders/Mono16Format.h
src/decoders/monounpackeddecoders/Mono8Format.h
src/decoders/monounpackeddecoders/Mono8SignedFormat.h
src/decoders/swscaledecoder.h
src/decoders/unsupported.h
src/filters/filter.h
src/filters/levels.h
src/getmtu_linux.h
src/glvideowidget.h
src/mainwindow.h
src/recorders/gstrecorder_implementation.h
src/recorders/gstrecorders.h
src/recorders/imagerecorder.h
src/recorders/rawrecorders.h
src/recorders/rawrecorders/decoded16.h
src/recorders/rawrecorders/decoded8.h
src/recorders/rawrecorders/undecoded.h
src/recorders/recorder.h
src/workthread.h

FORMS +=
src/filters/levels.ui
src/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

unix:!macx: LIBS += -L/usr/local/lib/ -lGevApi -ldarknet
-L/usr/lib/x86_64-linux-gnu/ -lavutil -lavcodec -lswscale

INCLUDEPATH += $$PWD/src
/usr/local/include/GigeV/include
/opt/genicam_v3_0/library/CPP/include
/usr/local/include
/usr/include/x86_64-linux-gnu

DEPENDPATH += $$PWD/src
$$PWD/src/decoders
/usr/local/include/GigeV/include
/opt/genicam_v3_0/library/CPP/include
/usr/local/include

from qarv.

exzombie avatar exzombie commented on July 20, 2024

OK, now I get it. You're trying to compile QArv itself with qmake, as part of compiling your own application. That's something I've never tried, and I don't know of anyone who did. The intended way to use QArv is to compile it on its own, install it with make install and then use it as a library by linking to it from your application, e.g. with qmake by declaring PKGCONFIG += qarv-3.

The issue of multiple definitions you have is because you are trying to do both: you first build QArv, and then link to the already installed QArv. So of course there would be multiple definitions of everything.

The best way to proceed is to use QArv the same way you use Aravis (or any other library): install it, then link against it. See my post above, that's literally all you need to get started; there is no need to have a complete copy of QArv in your project. How to proceed from there depends on which functionality of QArv you would like to use. I can provide advice, but it's out of scope of this issue, so we should discuss it over email.

from qarv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.