You probably need to add /usr/include/glib-2.0/ to your include search path.  This probably means mucking with the project build steps. You don't want to just add that directory to the CMakeFile since it will then be wrong for other peoples configurations.

Do you get the same error if you build pulseview from the command line?

On 5/11/2023 3:29 PM, Cedric de Wijs via sigrok-devel wrote:
I've tried to import pulseview in Qt, but I get the compile error "glib.h: No such file or directory"

Here are my steps:
0) make workdir:
$ mkdir sigrok-qt
$ cd sigrok-qt/
1) Clone the source from github
$ git clone git://sigrok.org/pulseview
2) Import into Qt creator:
Qt Creator -> File -> Open file or project -> CMakelists.txt ->  Open.
Configure Project
3) Start debugging:
Debug -> Start debugging -> Start debugging of startup project (F5). Now I get this error in Qt->4 Compile output:

20:59:57: Running steps for project pulseview...
20:59:57: Starting: "/usr/bin/cmake" --build /home/cedric/sigrok-qt/build-pulseview-Desktop-Debug --target all
[  1%] Automatic MOC for target pulseview
[  1%] Built target pulseview_autogen
[  2%] Generating l10n/de.qm
Updating '/home/cedric/sigrok-qt/build-pulseview-Desktop-Debug/l10n/de.qm'...
    Generated 288 translation(s) (288 finished and 0 unfinished)
[  3%] Generating l10n/es_MX.qm
Updating '/home/cedric/sigrok-qt/build-pulseview-Desktop-Debug/l10n/es_MX.qm'...
    Generated 289 translation(s) (289 finished and 0 unfinished)
[  4%] Generating l10n/ja_jp.qm
Updating '/home/cedric/sigrok-qt/build-pulseview-Desktop-Debug/l10n/ja_jp.qm'...
    Generated 320 translation(s) (320 finished and 0 unfinished)
    Ignored 79 untranslated source text(s)
[  5%] Generating qrc_translations.cpp
[  6%] Generating qrc_pulseview.cpp
[  7%] Building CXX object CMakeFiles/pulseview.dir/pulseview_autogen/mocs_compilation.cpp.o
In file included from /usr/include/libsigrokcxx/libsigrokcxx.hpp:73,
                 from /home/cedric/sigrok-qt/build-pulseview-Desktop-Debug/pulseview_autogen/PLNN4COFE5/../../../pulseview/pv/application.hpp:29,                  from /home/cedric/sigrok-qt/build-pulseview-Desktop-Debug/pulseview_autogen/PLNN4COFE5/moc_application.cpp:10,                  from /home/cedric/sigrok-qt/build-pulseview-Desktop-Debug/pulseview_autogen/mocs_compilation.cpp:2: /usr/include/libsigrok/libsigrok.h:27:10: fatal error: glib.h: No such file or directory
   27 | #include <glib.h>
      |          ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/pulseview.dir/build.make:210: CMakeFiles/pulseview.dir/pulseview_autogen/mocs_compilation.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:103: CMakeFiles/pulseview.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
20:59:59: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project pulseview (kit: Desktop)
When executing step "Build"
20:59:59: Elapsed time: 00:01.

I do have glib.h:
$ ls -l /usr/include/glib-2.0/glib.h
-rw-r--r-- 1 root root 3513 Apr 21 19:04 /usr/include/glib-2.0/glib.h

$ pkg-config --list-all | grep glib-
glib-2.0                       GLib - C Utility Library

$ pkg-config --path glib-2.0
/usr/lib/pkgconfig/glib-2.0.pc

Here are my versions:
$ uname -a
Linux cedric 6.3.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 01 May 2023 17:42:39 +0000 x86_64 GNU/Linux
$ git log
commit 3903edbd71789f8af1c3b133b5702bd1d66f9242 (HEAD -> master, origin/master, origin/HEAD)
$ qtcreator -version
Qt Creator 10.0.1 based on Qt 6.5.0
$ /usr/bin/cmake --version
cmake version 3.26.3

I have rebuild and reinstalled libsigrok-git from the AUR as suggested here:
https://bbs.archlinux.org/viewtopic.php?id=262012

I've then restarted from step 0 above, but the error remains the same.

Here's the cmake output from Qt -> 6 general messages:
Running /usr/bin/cmake -S /home/cedric/sigrok-qt/pulseview -B /home/cedric/sigrok-qt/build-pulseview-Desktop-Debug '-DCMAKE_GENERATOR:STRING=Unix Makefiles' -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/home/cedric/sigrok-qt/build-pulseview-Desktop-Debug/.qtc/package-manager/auto-setup.cmake -DQT_QMAKE_EXECUTABLE:STRING=/usr/bin/qmake -DCMAKE_PREFIX_PATH:STRING=/usr -DCMAKE_C_COMPILER:STRING=/usr/lib/ccache/bin/gcc -DCMAKE_CXX_COMPILER:STRING=/usr/lib/ccache/bin/g++ -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG in /home/cedric/sigrok-qt/build-pulseview-Desktop-Debug.
-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- creating symlink for manual's images/ subdirectory
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Performing Test HAVE_STD_CXX_17
-- Performing Test HAVE_STD_CXX_17 - Success
-- Performing Test HAVE_STD_CXX_14
-- Performing Test HAVE_STD_CXX_14 - Success
-- Performing Test HAVE_STD_CXX_11
-- Performing Test HAVE_STD_CXX_11 - Success
-- Using C++17 for the application build
-- Checking for module 'glibmm-2.4>2.28.0'
--   Found glibmm-2.4, version 2.66.6
-- Checking for module 'libsigrokcxx>=0.5.2'
--   Found libsigrokcxx, version 0.6.0-git
-- Checking for modules 'glib-2.0>=2.28.0;glibmm-2.4>=2.28.0;libsigrokcxx>=0.5.2;libsigrokdecode>=0.5.2'
--   Found glib-2.0, version 2.76.2
--   Found glibmm-2.4, version 2.66.6
--   Found libsigrokcxx, version 0.6.0-git
--   Found libsigrokdecode, version 0.6.0-git-d7da8b9
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
Package python-3.10-embed was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.10-embed.pc'
to the PKG_CONFIG_PATH environment variable
Package 'python-3.10-embed', required by 'libsigrokdecode', not found
-- Qt version: 5.15.9
-- Found Boost: /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.55") found components: filesystem serialization system
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Atomics provided by the C-library - yes
-- Performing Test HAVE_SRD_SESSION_SEND_EOF
-- Performing Test HAVE_SRD_SESSION_SEND_EOF - Failed
-- Performing Test HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS
-- Performing Test HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS - Success
-- PulseView version: 0.5.0-git-3903edb
-- Configuring done (1.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/cedric/sigrok-qt/build-pulseview-Desktop-Debug
Elapsed time: 00:01.

Kind regards,
Cedric

On 5/7/23 05:10, Joshua D. Boyd wrote:
Qt Creator uses cmake as its project file these days and it also works fairly well as a general c/c++ IDE beyond just Qt Gui code.

Pulseview imports into Qt Creator just fine because of this. Of course libsigrok and sigrok-cli don't use CMake. I would have said that you can't as easily import those projects into Qt Creator, but it seems there is now included (but not on by default) plugin to let Qt Creator use Makefile.am files. It seems to do OK with libsigrok and sigrok-cli, but I didn't test that much beyond seeing it open it as a project.

So, Cedric, in my opinion go for it and see how it goes.


On May 6, 2023 2:56:11 AM EDT, Vesa-Pekka Palmu <vpa...@depili.fi> wrote:

    Only pulseview uses Qt. And even that project has never been made
    with Qt creator, so modifying it for that IDE might be more
    trouble than it is worth. Main thing to remember is that if you
    end up using and IDE keep your patches still clean of IDE
    artefacts, as the target of the project will still be the cmake
    build to maintain cross platform availability. On Sat, 6 May
    2023, Cedric de Wijs via sigrok-devel wrote:

        Hi All, I would like to import the sigrok code into Qt
        Creator, so I can use that IDE to compiler and debug the
        code. Has anybody done this before? Is it OK to post my
        problems with this approach here? Cheers, Cedric
        ------------------------------------------------------------------------
        Your E-Mail. Your Cloud. Your Office. eclipso Mail & Cloud.
https://www.eclipso.de


_________________________________________________________________
________________________________________________________
Your E-Mail. Your Cloud. Your Office. eclipso Mail & 
Cloud.https://www.eclipso.de




_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to