Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Fails with Newest libgtkdatabox-dev #384

Open
chancecardona opened this issue Jul 15, 2022 · 8 comments
Open

Compilation Fails with Newest libgtkdatabox-dev #384

chancecardona opened this issue Jul 15, 2022 · 8 comments

Comments

@chancecardona
Copy link

On Debian bookworm amd64, with Testing PPA's enabled, the iio-oscilloscope does not compile correctly with the newest version of software. The error is due to the gtkdatabox versioning, despite passing the checks in the adi_update_tools.sh.
Expected Behavior:
Running CMake:

-- Checking for module 'gtkdatabox'
--   Found gtkdatabox, version 0.9.3.1
-- Checking for module 'fftw3'
--   Found fftw3, version 3.3.8
-- Checking for module 'libxml-2.0'
--   Found libxml-2.0, version 2.9.14
-- Checking for module 'libcurl'
--   Found libcurl, version 7.83.1
-- Checking for module 'jansson'
--   Found jansson, version 2.14
-- Checking for module 'matio'
--   Found matio, version 1.5.23
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chance/iio-oscilloscope/build

Make:

$ make -j $(nproc)
[  4%] Building C object CMakeFiles/osc.dir/datatypes.c.o
[  4%] Building C object CMakeFiles/osc.dir/oscplot.c.o
[  4%] Building C object CMakeFiles/osc.dir/osc.c.o
[  4%] Building C object CMakeFiles/osc.dir/iio_widget.c.o
[  6%] Building C object CMakeFiles/osc.dir/iio_utils.c.o
[  7%] Building C object CMakeFiles/osc.dir/fru.c.o
[  8%] Building C object CMakeFiles/osc.dir/dialogs.c.o
[  9%] Building C object CMakeFiles/osc.dir/trigger_dialog.c.o
[ 10%] Building C object CMakeFiles/osc.dir/xml_utils.c.o
[ 12%] Building C object CMakeFiles/osc.dir/libini/libini.c.o
[ 13%] Building C object CMakeFiles/osc.dir/libini2.c.o
[ 14%] Building C object CMakeFiles/osc.dir/phone_home.c.o
[ 15%] Building C object CMakeFiles/osc.dir/plugins/dac_data_manager.c.o
[ 16%] Building C object CMakeFiles/osc.dir/plugins/fir_filter.c.o
[ 18%] Building C object CMakeFiles/osc.dir/eeprom.c.o
[ 19%] Building C object CMakeFiles/osc.dir/osc_preferences.c.o
[ 20%] Linking C shared library libosc.so
[ 20%] Built target osc
[ 22%] Building C object plugins/CMakeFiles/fmcomms1.dir/fmcomms1.c.o
[ 22%] Building C object plugins/CMakeFiles/generic_dac.dir/generic_dac.c.o
[ 24%] Building C object plugins/CMakeFiles/fmcomms2.dir/fmcomms2.c.o
[ 25%] Building C object CMakeFiles/oscmain.dir/oscmain.c.o
[ 26%] Linking C shared library generic_dac.so
[ 27%] Linking C executable osc
[ 27%] Built target generic_dac
[ 28%] Building C object plugins/CMakeFiles/fmcomms2_adv.dir/fmcomms2_adv.c.o
[ 28%] Built target oscmain
[ 30%] Building C object plugins/CMakeFiles/fmcomms5.dir/fmcomms5.c.o
[ 31%] Linking C shared library fmcomms2_adv.so
[ 32%] Linking C shared library fmcomms2.so
[ 33%] Linking C shared library fmcomms1.so
[ 33%] Built target fmcomms2
[ 33%] Built target fmcomms2_adv
[ 33%] Built target fmcomms1
[ 36%] Building C object plugins/CMakeFiles/fmcomms6.dir/fmcomms6.c.o
[ 36%] Building C object plugins/CMakeFiles/fmcomms11.dir/fmcomms11.c.o
[ 37%] Building C object plugins/CMakeFiles/ad9371.dir/ad9371.c.o
[ 38%] Linking C shared library fmcomms6.so
[ 39%] Linking C shared library fmcomms11.so
[ 40%] Linking C shared library fmcomms5.so
[ 40%] Built target fmcomms6
[ 40%] Built target fmcomms11
[ 42%] Building C object plugins/CMakeFiles/ad9371_adv.dir/ad9371_adv.c.o
[ 42%] Built target fmcomms5
[ 43%] Building C object plugins/CMakeFiles/adrv9009.dir/adrv9009.c.o
[ 44%] Building C object plugins/CMakeFiles/adrv9009_adv.dir/adrv9009_adv.c.o
[ 45%] Linking C shared library ad9371_adv.so
[ 46%] Linking C shared library ad9371.so
[ 48%] Linking C shared library adrv9009_adv.so
[ 48%] Built target ad9371_adv
[ 49%] Building C object plugins/CMakeFiles/ad6676.dir/ad6676.c.o
[ 49%] Built target ad9371
[ 50%] Building C object plugins/CMakeFiles/fmcadc3.dir/fmcadc3.c.o
[ 50%] Built target adrv9009_adv
[ 51%] Building C object plugins/CMakeFiles/daq2.dir/daq2.c.o
[ 53%] Linking C shared library fmcadc3.so
[ 54%] Linking C shared library ad6676.so
[ 55%] Linking C shared library adrv9009.so
[ 55%] Built target fmcadc3
[ 56%] Building C object plugins/CMakeFiles/ad9739a.dir/ad9739a.c.o
[ 56%] Built target ad6676
[ 59%] Linking C shared library daq2.so
[ 59%] Building C object plugins/CMakeFiles/AD5628_1.dir/AD5628_1.c.o
[ 59%] Built target adrv9009
[ 60%] Building C object plugins/CMakeFiles/AD7303.dir/AD7303.c.o
[ 60%] Built target daq2
[ 61%] Building C object plugins/CMakeFiles/cn0357.dir/cn0357.c.o
[ 62%] Linking C shared library ad9739a.so
[ 63%] Linking C shared library AD5628_1.so
[ 63%] Built target ad9739a
[ 63%] Built target AD5628_1
[ 65%] Building C object plugins/CMakeFiles/cn0508.dir/cn0508.c.o
[ 66%] Linking C shared library AD7303.so
[ 67%] Building C object plugins/CMakeFiles/cn0511.dir/cn0511.c.o
[ 68%] Linking C shared library cn0357.so
[ 68%] Built target AD7303
[ 69%] Building C object plugins/CMakeFiles/cn0540.dir/cn0540.c.o
[ 69%] Built target cn0357
[ 71%] Building C object plugins/CMakeFiles/pr_config.dir/pr_config.c.o
[ 72%] Linking C shared library cn0511.so
[ 73%] Linking C shared library cn0508.so
[ 73%] Built target cn0511
[ 74%] Building C object plugins/CMakeFiles/motor_control.dir/motor_control.c.o
[ 74%] Built target cn0508
[ 75%] Building C object plugins/CMakeFiles/lidar.dir/lidar.c.o
[ 77%] Linking C shared library cn0540.so
[ 78%] Linking C shared library pr_config.so
[ 78%] Built target pr_config
[ 78%] Built target cn0540
[ 79%] Building C object plugins/CMakeFiles/dmm.dir/dmm.c.o
[ 80%] Building C object plugins/CMakeFiles/debug.dir/debug.c.o
[ 81%] Linking C shared library lidar.so
[ 81%] Built target lidar
[ 83%] Building C object plugins/CMakeFiles/spectrum_analyzer.dir/spectrum_analyzer.c.o
[ 84%] Linking C shared library motor_control.so
[ 85%] Linking C shared library dmm.so
[ 85%] Built target motor_control
[ 86%] Building C object plugins/CMakeFiles/scpi.dir/scpi.c.o
[ 86%] Built target dmm
[ 87%] Building C object plugins/CMakeFiles/ad9081.dir/ad9081.c.o
[ 89%] Linking C shared library spectrum_analyzer.so
[ 90%] Linking C shared library debug.so
[ 90%] Built target spectrum_analyzer
[ 91%] Building C object plugins/CMakeFiles/adrv9002.dir/adrv9002.c.o
[ 91%] Built target debug
[ 92%] Building C object plugins/CMakeFiles/cf_axi_tdd.dir/cf_axi_tdd.c.o
[ 93%] Linking C shared library ad9081.so
[ 93%] Built target ad9081
[ 95%] Building C object plugins/CMakeFiles/xmw.dir/xmw.c.o
[ 96%] Linking C shared library scpi.so
[ 97%] Linking C shared library cf_axi_tdd.so
[ 97%] Built target scpi
[ 97%] Built target cf_axi_tdd
[ 98%] Linking C shared library xmw.so
[ 98%] Built target xmw
[100%] Linking C shared library adrv9002.so
[100%] Built target adrv9002

Observed Behavior:
Running CMake:

-- The C compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/bin/git (found version "2.35.1") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'glib-2.0'
--   Found glib-2.0, version 2.72.3
-- Checking for module 'gtk+-2.0'
--   Found gtk+-2.0, version 2.24.33
-- Checking for module 'gthread-2.0'
--   Found gthread-2.0, version 2.72.3
-- Checking for module 'gtkdatabox'
--   Found gtkdatabox, version 1.0.0
-- Checking for module 'fftw3'
--   Found fftw3, version 3.3.8
-- Checking for module 'libxml-2.0'
--   Found libxml-2.0, version 2.9.14
-- Checking for module 'libcurl'
--   Found libcurl, version 7.83.1
-- Checking for module 'jansson'
--   Found jansson, version 2.14
-- Checking for module 'matio'
--   Found matio, version 1.5.23
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chance/iio-oscilloscope/build

Make:

$ make -j $(nproc)
[  4%] Building C object CMakeFiles/osc.dir/iio_widget.c.o
[  4%] Building C object CMakeFiles/osc.dir/datatypes.c.o
[  4%] Building C object CMakeFiles/osc.dir/osc.c.o
[  4%] Building C object CMakeFiles/osc.dir/oscplot.c.o
In file included from /usr/include/gtkdatabox.h:24,
                 from /home/chance/iio-oscilloscope/datatypes.h:12,
                 from /home/chance/iio-oscilloscope/datatypes.c:9:
/usr/include/gtkdatabox_graph.h:100:38: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
  100 |                                      GdkRGBA * color);
      |                                      ^~~~~~~
      |                                      GdkGC
/usr/include/gtkdatabox_graph.h:101:4: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
  101 |    GdkRGBA *gtk_databox_graph_get_color (GtkDataboxGraph * graph);
      |    ^~~~~~~
      |    GdkGC
In file included from /usr/include/gtkdatabox.h:24,
                 from /home/chance/iio-oscilloscope/oscplot.c:9:

...

/usr/include/gtkdatabox_lines.h:86:21: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
   86 |                     GdkRGBA * color, guint size);
      |                     ^~~~~~~
      |                     GdkGC
In file included from /home/chance/iio-oscilloscope/oscplot.c:13:
/usr/include/gtkdatabox_markers.h:149:45: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
  149 |                                             GdkRGBA * color, guint size,
      |                                             ^~~~~~~
      |                                             GdkGC
In file included from /home/chance/iio-oscilloscope/osc.c:12:
/usr/include/gtkdatabox_markers.h:149:45: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
  149 |                                             GdkRGBA * color, guint size,
      |                                             ^~~~~~~
      |                                             GdkGC
/usr/include/gtkdatabox_markers.h:164:25: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
  164 |                         GdkRGBA * color, guint size,
      |                         ^~~~~~~
      |                         GdkGC
/usr/include/gtkdatabox_markers.h:164:25: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
  164 |                         GdkRGBA * color, guint size,
      |                         ^~~~~~~
      |                         GdkGC
make[2]: *** [CMakeFiles/osc.dir/build.make:76: CMakeFiles/osc.dir/osc.c.o] Error 1
/home/chance/iio-oscilloscope/oscplot.c: In function ‘markers_init’:
/home/chance/iio-oscilloscope/oscplot.c:2651:36: error: implicit declaration of function ‘gtk_databox_markers_new’; did you mean ‘gtk_databox_ruler_new’? [-Werror=implicit-function-declaration]
 2651 |                 markers[i].graph = gtk_databox_markers_new(1, &markers[i].x, &markers[i].y, &color_marker,
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~
      |                                    gtk_databox_ruler_new
/home/chance/iio-oscilloscope/oscplot.c:2651:34: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
 2651 |                 markers[i].graph = gtk_databox_markers_new(1, &markers[i].x, &markers[i].y, &color_marker,
      |                                  ^

...
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/osc.dir/build.make:90: CMakeFiles/osc.dir/oscplot.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/osc.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

The resolution was found by installing the stable versions of the package, namely libgtkdatabox0_0.9.3.1-2 and libgtkdatabox-dev_0.9.3.1-2

@dNechita
Copy link
Contributor

Hi,
We are currently in the process of migrating iio-oscilloscope from GTK2 to GTK3. This also means it will move from libgtkdatabox 0.9 to 1.0.
Once the migration is finished you won't be encountering this kind of error.

@ly2ss
Copy link

ly2ss commented Nov 4, 2022

Is there any way to run osc on Ubuntu 22.04LTS while migration lasts? It has libgtkdatabox 1.0.
f.e. install libgtkdatabox 0.9 and link against it.

@nunojsa
Copy link
Contributor

nunojsa commented Nov 4, 2022

Is there any way to run osc on Ubuntu 22.04LTS while migration lasts? It has libgtkdatabox 1.0.
f.e. install libgtkdatabox 0.9 and link against it.

You can get the source code and try to compile it yourself (you need to also make sure you don't have any other package relying libgtkdatabox 1.0. so you can uninstall it). But do you have any hard requirement to run iut un 22.04LTS? I would just recommend to use docker and create an image based on ubuntu 20.04 already with osc built and run it from the container... It is possible to run GUI apps inside a docker container

@dNechita
Copy link
Contributor

dNechita commented Nov 4, 2022

Just a note. We are close to finishing the transition to GTK3. It should be completed by the middle of this month.

@ghost
Copy link

ghost commented Jan 15, 2023

@dNechita I'm new to the world of Linux apps and just spent 2.5 days trying to install the IIO osc application. I was having the same issue with the gtkdatabox that the OP of this issue reported. All my issues were resolved by downgrading my Ubuntu install from 22.04 to 20.04. I was hoping could you explain to a noob why I was able to build on the older Ubuntu, but not the newer one?

@dNechita
Copy link
Contributor

On Ubuntu 20.04, when you install gtkdatabox via apt, you will receive a package with version 0.9.whatever. This package is based on GTK2. Since gtkdatabox is a widget used within iio-osc, osc also needs to be based on GTK2, and it is. So build succeeds.
On Ubuntu 22.04 you are no longer getting a gtkdatabox package based on GTK2 but on GTK3. Version will be 1.whatever.
So in this case the build process of iio-osc will notice gtkdatabox has GTK3 dependencies and will try to build iio-osc with GTK3 as well. But iio-osc code was written for GTK2 so it won't compile.

@ghost
Copy link

ghost commented Jan 28, 2023

Thank you @dNechita !

@John132-LI
Copy link

Hello, I encounter a similar issue.I have follow https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope to install ,but when "sudo make install", the error occurs.Here's the log

In file included from /usr/include/gtkdatabox.h:24,
from /home/user/Desktop/iio-oscilloscope/osc.c:8:
/usr/include/gtkdatabox_graph.h:86:7: error: unknown type name ‘GdkGC’
86 | GdkGC* (create_gc) (GtkDataboxGraph * graph, GtkDatabox * box);
| ^~~~~
/usr/include/gtkdatabox_graph.h:91:4: error: unknown type name ‘GdkGC’; did you mean ‘GdkRGBA’?
91 | GdkGC
gtk_databox_graph_get_gc (GtkDataboxGraph * graph);
| ^~~~~
| GdkRGBA
/usr/include/gtkdatabox_graph.h:92:60: error: unknown type name ‘GdkGC’; did you mean ‘GdkRGBA’?
92 | void gtk_databox_graph_set_gc (GtkDataboxGraph * graph, GdkGC gc);
| ^~~~~
| GdkRGBA
/usr/include/gtkdatabox_graph.h:111:4: error: unknown type name ‘GdkGC’; did you mean ‘GdkRGBA’?
111 | GdkGC
gtk_databox_graph_create_gc (GtkDataboxGraph * graph, GtkDatabox * box);
| ^~~~~
| GdkRGBA
In file included from /home/user/Desktop/iio-oscilloscope/osc.c:8:
/usr/include/gtkdatabox.h:196:1: error: unknown type name ‘GdkPixmap’; did you mean ‘GdkPixbuf’?
196 | GdkPixmap* gtk_databox_get_backing_pixmap(GtkDatabox * box);
| ^~~~~~~~~
| GdkPixbuf
make[2]: *** [CMakeFiles/osc.dir/build.make:63: CMakeFiles/osc.dir/osc.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:183: CMakeFiles/osc.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Could someone tell me how to deal with it?Much appreciation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants