parnoldx / nasc

Do maths like a normal person
http://parnoldx.github.io/nasc/
GNU General Public License v3.0
560 stars 37 forks source link

Doesn't build with libqalculate 3.9.0 #145

Closed doronbehar closed 4 years ago

doronbehar commented 4 years ago

On NixOS, we would like to update libqalculate to 3.9.0 per https://github.com/Qalculate/libqalculate/releases/tag/v3.9.0 . When testing dependencies of it in our packages collection, we are hitting this error for nasc:

building
build flags: -j2 -l2 SHELL=/nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash
Scanning dependencies of target qalculatenasc
[  5%] Building CXX object libqalculatenasc/CMakeFiles/qalculatenasc.dir/QalculateNasc.cc.o
/build/source/libqalculatenasc/QalculateNasc.cc: In function 'char* get_function_name(int)':
/build/source/libqalculatenasc/QalculateNasc.cc:38:13: error: 'string' was not declared in this scope; did you mean 'std::string'?
   38 |             string str = ename_r->name;
      |             ^~~~~~
      |             std::string
parnoldx commented 4 years ago

Sounds like some compiler issue like https://github.com/parnold-x/nasc/pull/143

parnoldx commented 4 years ago

replace all string with std::string if you want to fix this. Master has libqalculate as submodule now

jtojnar commented 4 years ago

Using libqualculate as a submodule is not very good for Linux distros since we now need to fix issues in both the libqualculate package and nasc.

parnoldx commented 4 years ago

libqalculate in the ubuntu repos is ages old, so it's the way it will be.

jtojnar commented 4 years ago

There are ways to use a submodule on ancient distros and the system variant on modern ones. It is actually pretty easy in Meson: https://mesonbuild.com/Subprojects.html#toggling-between-system-libraries-and-embedded-sources

doronbehar commented 4 years ago

Also, I didn't manage to figure out how was this a "fix" for the issue presented - we are not ubuntu, the issue was with a rather recent libqalculate version we tried to use, isn't libqalculate 3.9.0 recent enough for your latest releases?

parnoldx commented 4 years ago

The submodule switch has nothing todo with this bug. The target is the elementary OS and there a ancient libqalculate is present so that's why a submodule is used now.