svenstaro / rofi-calc

🖩 Do live calculations in rofi!
MIT License
991 stars 32 forks source link

calc-command error helper_string_replace_if_exists #28

Closed gustabot42 closed 5 years ago

gustabot42 commented 5 years ago

Hi, when trying to use calc-command I get the following error

rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo '{result}' | xclip"
rofi: symbol lookup error: /usr/lib64/rofi/calc.so: undefined symbol: helper_string_replace_if_exists
svenstaro commented 5 years ago

Sounds like an out of date system installed rofi-calc to me. Can you check whether building it from git results in the same issue?

gustabot42 commented 5 years ago

at night I compile it, but now this is the version I use

Installed Packages
Name         : rofi-calc
Version      : 1.5
Release      : 1.2
Architecture : x86_64
Size         : 27 k
Source       : rofi-calc-1.5-1.2.src.rpm
Repository   : @System
From repo    : @commandline
Summary      : Calculator for rofi
URL          : https://github.com/svenstaro/rofi-calc
License      : MIT
Description  : A rofi plugin that uses libqalculate's qalc to parse natural language
             : input and provide results.
             :
             : Since this uses libqalculate's qalc, natural language queries such as
             : "500 + 25%" or "5000 EUR to USD" or "150 to hex" can be input.
             : It can also solve linear equations on the fly, like "60x + 30 = 50"
             : for instance.
svenstaro commented 5 years ago

Well, it definitely sounds like some kind of ABI incompatibility. We'll figure it out once you compile it yourself.

acheronfail commented 5 years ago

I just compiled this from git myself, and am seeing the same issue (running ubuntu 19.04).

Here's my output from make:

make  all-am
make[1]: Entering directory '/home/acheronfail/src/rofi-calc/build'
/bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2 -MT src/calc_la-calc.lo -MD -MP -MF src/.deps/calc_la-calc.Tpo -c -o src/calc_la-calc.lo `test -f 'src/calc.c' || echo '../'`src/calc.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2 -MT src/calc_la-calc.lo -MD -MP -MF src/.deps/calc_la-calc.Tpo -c ../src/calc.c  -fPIC -DPIC -o src/.libs/calc_la-calc.o
../src/calc.c: In function ‘execsh’:
../src/calc.c:288:22: warning: implicit declaration of function ‘helper_string_replace_if_exists’ [-Wimplicit-function-declaration]
     char *user_cmd = helper_string_replace_if_exists(cmd,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/calc.c:288:22: warning: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
mv -f src/.deps/calc_la-calc.Tpo src/.deps/calc_la-calc.Plo
/bin/bash ./libtool  --tag=CC   --mode=link gcc -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2 -module -avoid-version  -o calc.la -rpath /usr/lib/x86_64-linux-gnu/rofi// src/calc_la-calc.lo -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0  -lcairo 
libtool: link: gcc -shared  -fPIC -DPIC  src/.libs/calc_la-calc.o   -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lcairo  -pthread -pthread -g -O2 -Wl,--export-dynamic -pthread   -pthread -Wl,-soname -Wl,calc.so -o .libs/calc.so
libtool: link: ( cd ".libs" && rm -f "calc.la" && ln -s "../calc.la" "calc.la" )
make[1]: Leaving directory '/home/acheronfail/src/rofi-calc/build'
svenstaro commented 5 years ago

Sorry, I really don't know. It should be there.

yoshimoto commented 5 years ago

helper_string_replace_if_exists () is not available before rofi-1.5.2.

I wrote two patches to avoid this issue. See pull request for details.