phase1geo / Annotator

Image annotation for Elementary OS
GNU General Public License v3.0
218 stars 22 forks source link

Failed to build : error: The name `drop' does not exist in the context of `Gtk.DropTarget' (gtk4) #110

Closed lidgnulinux closed 4 days ago

lidgnulinux commented 4 days ago

Hello, I'm trying to build Annotator and facing this error :

../src/MainWindow.vala:339.5-339.13: error: The name `drop' does not exist in the context of `Gtk.DropTarget' (gtk4)

Full errors are :

[14/90] Compiling Vala source ../src/Application.vala ../src/BufferSurface.vala ../src/Canvas.vala ../src/CanvasImage.vala ../src/CanvasImageInfo.vala ../src/CanvasItem.vala ../src/CanvasItemMenu.vala ../src/CanvasItemProperties.vala ../src/CanvasItems.vala ../src/CanvasPoint.vala ../src/CanvasRect.vala ../src/CanvasToolbar.vala ../src/Clipboard.vala ../src/ColorPicker.vala ../src/CurrentItem.vala ../src/CustomItem.vala ../src/CustomItems.vala ../src/Editor.vala ../src/Export.vala ../src/Exports.vala ../src/Exporter.vala ../src/FormatBar.vala ../src/FormattedText.vala ../src/MainWindow.vala ../src/Resizer.vala ../src/ScreenshotBackend.vala ../src/StickerSet.vala ../src/UndoBuffer.vala ../src/UndoItem.vala ../src/UndoTextBuffer.vala ../src/UndoTextItem.vala ../src/Utils.vala ../src/ZoomWidget.vala ../src/canvas_items/CanvasItemArrow.vala ../src/canvas_items/CanvasItemBlur.vala ../src/canvas_items/CanvasItemBubble.vala ../src/canvas_items/CanvasItemImage.vala ../src/canvas_items/CanvasItemLine.vala ../src/canvas_items/CanvasItemMagnifier.vala ../src/canvas_items/CanvasItemOval.vala ../src/canvas_items/CanvasItemPencil.vala ../src/canvas_items/CanvasItemRect.vala ../src/canvas_items/CanvasItemSequence.vala ../src/canvas_items/CanvasItemStar.vala ../src/canvas_items/CanvasItemText.vala ../src/exports/ExportClipboard.vala ../src/exports/ExportImage.vala ../src/exports/ExportPDF.vala ../src/exports/ExportPNG.vala ../src/exports/ExportPrint.vala ../src/exports/ExportSVG.vala ../src/undo_actions/UndoImageChange.vala ../src/undo_actions/UndoImageResize.vala ../src/undo_actions/UndoItemAdd.vala ../src/undo_actions/UndoItemBlur.vala ../src/undo_actions/UndoItemBoxChange.vala ../src/undo_actions/UndoItemDelete.vala ../src/undo_actions/UndoItemMagnifierFocus.vala ../src/undo_actions/UndoItemMagnifierZoom.vala ../src/undo_actions/UndoItemPaste.vala ../src/undo_actions/UndoItemPropChange.vala ../src/undo_actions/UndoItemSendBack.vala ../src/undo_actions/UndoItemSendFront.vala ../src/undo_actions/UndoItemSequenceNum.vala ../src/undo_actions/UndoItemStarPoints.vala ../src/undo_actions/UndoItemTextResize.vala ../src/undo_actions/UndoTextClearTags.vala ../src/undo_actions/UndoTextCommit.vala ../src/undo_actions/UndoTextDelete.vala ../src/undo_actions/UndoTextInsert.vala ../src/undo_actions/UndoTextMultiInsert.vala ../src/undo_actions/UndoTextReplace.vala ../src/undo_actions/UndoTextTagAdd.vala ../src/undo_actions/UndoTextTagRemove.vala Config.vala
ninja: job failed: valac -C --debug --define=GTK322 --disable-warnings --pkg pangocairo --pkg libportal-gtk4 --pkg libxml-2.0 --pkg gtk4 --pkg granite-7 --pkg gee-0.8 --pkg glib-2.0 --pkg gobject-2.0 --color=always --directory com.github.phase1geo.annotator.p --basedir ../ --gresources=../data/com.github.phase1geo.annotator.gresource.xml --gresourcesdir=../data --gresourcesdir=.. ../src/Application.vala ../src/BufferSurface.vala ../src/Canvas.vala ../src/CanvasImage.vala ../src/CanvasImageInfo.vala ../src/CanvasItem.vala ../src/CanvasItemMenu.vala ../src/CanvasItemProperties.vala ../src/CanvasItems.vala ../src/CanvasPoint.vala ../src/CanvasRect.vala ../src/CanvasToolbar.vala ../src/Clipboard.vala ../src/ColorPicker.vala ../src/CurrentItem.vala ../src/CustomItem.vala ../src/CustomItems.vala ../src/Editor.vala ../src/Export.vala ../src/Exports.vala ../src/Exporter.vala ../src/FormatBar.vala ../src/FormattedText.vala ../src/MainWindow.vala ../src/Resizer.vala ../src/ScreenshotBackend.vala ../src/StickerSet.vala ../src/UndoBuffer.vala ../src/UndoItem.vala ../src/UndoTextBuffer.vala ../src/UndoTextItem.vala ../src/Utils.vala ../src/ZoomWidget.vala ../src/canvas_items/CanvasItemArrow.vala ../src/canvas_items/CanvasItemBlur.vala ../src/canvas_items/CanvasItemBubble.vala ../src/canvas_items/CanvasItemImage.vala ../src/canvas_items/CanvasItemLine.vala ../src/canvas_items/CanvasItemMagnifier.vala ../src/canvas_items/CanvasItemOval.vala ../src/canvas_items/CanvasItemPencil.vala ../src/canvas_items/CanvasItemRect.vala ../src/canvas_items/CanvasItemSequence.vala ../src/canvas_items/CanvasItemStar.vala ../src/canvas_items/CanvasItemText.vala ../src/exports/ExportClipboard.vala ../src/exports/ExportImage.vala ../src/exports/ExportPDF.vala ../src/exports/ExportPNG.vala ../src/exports/ExportPrint.vala ../src/exports/ExportSVG.vala ../src/undo_actions/UndoImageChange.vala ../src/undo_actions/UndoImageResize.vala ../src/undo_actions/UndoItemAdd.vala ../src/undo_actions/UndoItemBlur.vala ../src/undo_actions/UndoItemBoxChange.vala ../src/undo_actions/UndoItemDelete.vala ../src/undo_actions/UndoItemMagnifierFocus.vala ../src/undo_actions/UndoItemMagnifierZoom.vala ../src/undo_actions/UndoItemPaste.vala ../src/undo_actions/UndoItemPropChange.vala ../src/undo_actions/UndoItemSendBack.vala ../src/undo_actions/UndoItemSendFront.vala ../src/undo_actions/UndoItemSequenceNum.vala ../src/undo_actions/UndoItemStarPoints.vala ../src/undo_actions/UndoItemTextResize.vala ../src/undo_actions/UndoTextClearTags.vala ../src/undo_actions/UndoTextCommit.vala ../src/undo_actions/UndoTextDelete.vala ../src/undo_actions/UndoTextInsert.vala ../src/undo_actions/UndoTextMultiInsert.vala ../src/undo_actions/UndoTextReplace.vala ../src/undo_actions/UndoTextTagAdd.vala ../src/undo_actions/UndoTextTagRemove.vala Config.vala
../src/MainWindow.vala:339.5-339.13: error: The name `drop' does not exist in the context of `Gtk.DropTarget' (gtk4)
  339 |     drop.drop.connect((val, x, y) => {
      |     ^~~~~~~~~                         
Compilation failed: 1 error(s), 0 warning(s)

I'm using GTK 4, both 4.14.4 and 4.16.5 show same errors. Any Clue ? Thanks Oh Almost forget, I'm using Dragora GNU/Linux.

phase1geo commented 4 days ago

This is puzzling. I'm looking at the Gtk source code for 4.14.5 and there most definitely is a signal called "drop". Doesn't look like this signal has been deprecated according to valadoc.org either. FYI, for development purposes, I am using the 4.12 version of Gtk as that is what is available in the 24.10 Ubuntu LTS release.

lidgnulinux commented 4 days ago

Okay, good clue @phase1geo . I will downgrade my GTK 4.

lidgnulinux commented 4 days ago

So, I don't have time to rebuild and downgrade GTK, luckily when I comment at drop function, it's able to be built and works fine. Sadly, it seems only opened on X11, Annotator complains about no Display on wayland though I use GDK_BACKEND=wayland.

lidgnulinux commented 4 days ago

I decide to stick with 1.2.1 version, it works fine. Thanks.