From e389f9980249f51ed98564ffff208b67c3bcfbe2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 Sep 2022 10:00:18 +0200 Subject: [PATCH] Work around strange build error on Ubuntu 18.04 tmp/cc4JuI65.s: Assembler messages: /tmp/cc4JuI65.s:174: Error: symbol `_ZNSt14_Function_base13_Base_managerIUlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE_E10_M_managerERSt9_Any_dataRKS9_St18_Manager_operation' is already defined --- src/lib/create_cli.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc index a6e13c8bc..107311d59 100644 --- a/src/lib/create_cli.cc +++ b/src/lib/create_cli.cc @@ -176,6 +176,10 @@ CreateCLI::CreateCLI (int argc, char* argv[]) claimed = true; } + std::function (string s)> string_to_string = [](string s) { + return s; + }; + std::function (string s)> string_to_path = [](string s) { return boost::filesystem::path(s); }; @@ -212,7 +216,10 @@ CreateCLI::CreateCLI (int argc, char* argv[]) argument_option(i, argc, argv, "", "--channel", &claimed, &error, &channel, convert_channel); argument_option(i, argc, argv, "", "--gain", &claimed, &error, &gain); argument_option(i, argc, argv, "", "--kdm", &claimed, &error, &kdm, string_to_path); - argument_option(i, argc, argv, "", "--cpl", &claimed, &error, &cpl); + /* It shouldn't be necessary to use this string_to_string here, but using the other argument_option() + * causes an odd compile error on Ubuntu 18.04. + */ + argument_option(i, argc, argv, "", "--cpl", &claimed, &error, &cpl, string_to_string); if (!claimed) { if (a.length() > 2 && a.substr(0, 2) == "--") { -- 2.30.2