marvinkreis / rofi-file-browser-extended

Use rofi to quickly open files
MIT License
240 stars 15 forks source link

Compilation Error: MENU_CUSTOM_COMMAND undeclared #36

Closed alichtman closed 2 years ago

alichtman commented 3 years ago
$ make
make[1]: Entering directory '/opt/rofi-file-browser-extended'
make[2]: Entering directory '/opt/rofi-file-browser-extended'
Scanning dependencies of target manpage
make[2]: Leaving directory '/opt/rofi-file-browser-extended'
make[2]: Entering directory '/opt/rofi-file-browser-extended'
[ 11%] Packing manpage
make[2]: Leaving directory '/opt/rofi-file-browser-extended'
[ 11%] Built target manpage
make[2]: Entering directory '/opt/rofi-file-browser-extended'
Scanning dependencies of target filebrowser
make[2]: Leaving directory '/opt/rofi-file-browser-extended'
make[2]: Entering directory '/opt/rofi-file-browser-extended'
[ 22%] Building C object CMakeFiles/filebrowser.dir/src/cmds.c.o
[ 33%] Building C object CMakeFiles/filebrowser.dir/src/filebrowser.c.o
[ 44%] Building C object CMakeFiles/filebrowser.dir/src/files.c.o
[ 55%] Building C object CMakeFiles/filebrowser.dir/src/icons.c.o
/opt/rofi-file-browser-extended/src/icons.c: In function ‘request_icons_for_file’:
/opt/rofi-file-browser-extended/src/icons.c:46:37: warning: implicit declaration of function ‘rofi_icon_fetcher_file_is_image’; did you mean ‘rofi_icon_fetcher_destroy’? [-Wimplicit-function-declaration]
   46 |         if ( id->show_thumbnails && rofi_icon_fetcher_file_is_image( fbfile->path ) ) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     rofi_icon_fetcher_destroy
[ 66%] Building C object CMakeFiles/filebrowser.dir/src/keys.c.o
/opt/rofi-file-browser-extended/src/keys.c: In function ‘get_key_for_rofi_mretv’:
/opt/rofi-file-browser-extended/src/keys.c:50:25: error: ‘MENU_CUSTOM_COMMAND’ undeclared (first use in this function); did you mean ‘MENU_CUSTOM_ACTION’?
   50 |     } else if ( mretv & MENU_CUSTOM_COMMAND ) {
      |                         ^~~~~~~~~~~~~~~~~~~
      |                         MENU_CUSTOM_ACTION
/opt/rofi-file-browser-extended/src/keys.c:50:25: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [CMakeFiles/filebrowser.dir/build.make:115: CMakeFiles/filebrowser.dir/src/keys.c.o] Error 1
make[2]: Leaving directory '/opt/rofi-file-browser-extended'
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/filebrowser.dir/all] Error 2
make[1]: Leaving directory '/opt/rofi-file-browser-extended'
make: *** [Makefile:130: all] Error 2
pianoslum commented 2 years ago

Hi @alichtman , I also tried to compile the project (cmake + make) and it seemed to work out of the box. Could you maybe try again with the latest master? Otherwise some info about OS and so on could be helpful. Cheers

alichtman commented 2 years ago

Still no luck.

$ cmake --version && make --version && neofetch
cmake version 3.18.4
...
GNU Make 4.3
Built for x86_64-pc-linux-gnu
...

            .-/+oossssoo+/-.               alichtman@arctic 
        `:+ssssssssssssssssss+:`           ---------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 21.04 x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: X570 AORUS PRO WIFI -CF 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.11.0-34-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 36 days, 4 hours, 12 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 3642 (dpkg), 29 (flatpak), 22 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: zsh 5.8 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 2560x1440 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   DE: GNOME 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   WM Theme: Yaru-dark 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Theme: Yaru-dark [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Icons: Yaru [GTK2/3] 
  +sssssssssdmydMMMMMMMMddddyssssssss+     Terminal: gnome-terminal 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz 
    .ossssssssssssssssssdMMMNysssso.       GPU: NVIDIA GeForce RTX 2060 
      -+sssssssssssssssssyyyssss+-         Memory: 16705MiB / 32115MiB 
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.                                       
pianoslum commented 2 years ago

My guess is that you have an older rofi-version installed. Seems like your ubuntu-version ships 1.5.4 ( https://ubuntu.pkgs.org/21.04/ubuntu-universe-amd64/rofi_1.5.4-1_amd64.deb.html ) According to the readme 1.6.0+ is needed (I have 1.7.0

Do you have the chance to upgrade?

alichtman commented 2 years ago

I did upgrade rofi, but this is a C compilation error.

pianoslum commented 2 years ago

Yes, but rofi headers are used for the compilation as well. If you can really ascertain, that you use the latest rofi-headers for compilation, I'm out of ideas - sorry.

alichtman commented 2 years ago

Oh, I see the issue. Manually updating rofi and installing a new binary doesn't impact the rofi headers on my system, which are 1.5.4-1:

$  rofi -version
Version: 1.7.0-48-git-06bb72d3-dirty (next)

$ sudo apt install rofi-dev                                                                                                     Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
rofi-dev is already the newest version (1.5.4-1).
The following packages were automatically installed and are no longer required:
  dvdauthor dvgrab libmlt++3 libmlt-data libmlt6 libquicktime2 librttr-core0.9.6 melt oxygen-icon-theme recordmydesktop swh-plugins
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Updating the headers would solve my problem. I'm not sure how to do this on Ubuntu, but at least we have a root cause.

pianoslum commented 2 years ago

Seems like you have two rofi versions installed: 1.5.4 from your distribution and a newer one. The question is, which one do you want to use with file-browser-extended? The former doesn't work as we know. If you can use the newer rofi, it's no problem to get the headers for compilation. Maybe from the source you used to install it from or just from github. You just have to pass CMake/Make the correct path and load the compiled binary into rofi.

alichtman commented 2 years ago

My understanding of this issue is that the compiler is looking for symbols defined in the latest version of rofi, that don't exist in the currently installed headers I have. I have an updated binary, but this doesn't rely on those installed headers.

Here is the file listing: https://packages.debian.org/bullseye/arm64/rofi-dev/filelist

I just need to replace the following with updated versions:

/usr/include/rofi/helper.h
/usr/include/rofi/mode-private.h
/usr/include/rofi/mode.h
/usr/include/rofi/rofi-icon-fetcher.h
/usr/include/rofi/rofi-types.h

I manually updated the header files.

arctic# rm /usr/include/rofi/*.h && cd /usr/include/rofi
arctic# wget https://raw.githubusercontent.com/davatorium/rofi/next/include/helper.h
--2021-10-27 02:26:32--  https://raw.githubusercontent.com/davatorium/rofi/next/include/helper.h
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12511 (12K) [text/plain]
Saving to: ‘helper.h’

helper.h                           100%[================================================================>]  12.22K  --.-KB/s    in 0.001s

2021-10-27 02:26:32 (11.0 MB/s) - ‘helper.h’ saved [12511/12511]

arctic# wget https://raw.githubusercontent.com/davatorium/rofi/next/include/mode-private.h
--2021-10-27 02:26:42--  https://raw.githubusercontent.com/davatorium/rofi/next/include/mode-private.h
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5763 (5.6K) [text/plain]
Saving to: ‘mode-private.h’

mode-private.h                     100%[================================================================>]   5.63K  --.-KB/s    in 0s

2021-10-27 02:26:43 (96.6 MB/s) - ‘mode-private.h’ saved [5763/5763]

arctic# wget https://raw.githubusercontent.com/davatorium/rofi/next/include/mode.h
--2021-10-27 02:26:47--  https://raw.githubusercontent.com/davatorium/rofi/next/include/mode.h
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6721 (6.6K) [text/plain]
Saving to: ‘mode.h’

mode.h                             100%[================================================================>]   6.56K  --.-KB/s    in 0.004s

2021-10-27 02:26:47 (1.73 MB/s) - ‘mode.h’ saved [6721/6721]

arctic# wget https://raw.githubusercontent.com/davatorium/rofi/next/include/rofi-icon-fetcher.h
--2021-10-27 02:26:54--  https://raw.githubusercontent.com/davatorium/rofi/next/include/rofi-icon-fetcher.h
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2063 (2.0K) [text/plain]
Saving to: ‘rofi-icon-fetcher.h’

rofi-icon-fetcher.h                100%[================================================================>]   2.01K  --.-KB/s    in 0s

2021-10-27 02:26:54 (62.3 MB/s) - ‘rofi-icon-fetcher.h’ saved [2063/2063]

arctic# wget https://raw.githubusercontent.com/davatorium/rofi/next/include/rofi-types.h
--2021-10-27 02:27:01--  https://raw.githubusercontent.com/davatorium/rofi/next/include/rofi-types.h
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5883 (5.7K) [text/plain]
Saving to: ‘rofi-types.h’

rofi-types.h                       100%[================================================================>]   5.75K  --.-KB/s    in 0s

2021-10-27 02:27:01 (98.0 MB/s) - ‘rofi-types.h’ saved [5883/5883]

I can then compile the project successfully.

rofi-file-browser-extended🔒 on  master [?] via △ v3.18.4 took 3ms
02:28:52 AM $ cmake . && make && make install
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/rofi-file-browser-extended
[ 11%] Built target manpage
[100%] Built target filebrowser
[ 11%] Built target manpage
[100%] Built target filebrowser
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/lib/x86_64-linux-gnu/rofi/filebrowser.so
-- Up-to-date: /usr/share/man/man1/rofi-file-browser-extended.1.gz

Thanks for the help :)