Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbols: dynv::types::xml::write #222

Open
ryandesign opened this issue Jun 7, 2023 · 1 comment
Open

Undefined symbols: dynv::types::xml::write #222

ryandesign opened this issue Jun 7, 2023 · 1 comment

Comments

@ryandesign
Copy link
Contributor

ryandesign commented Jun 7, 2023

Building gpick 0.3 (with patches for #109, #215, #216, #220) with scons on macOS 12 fails for me with:

/usr/bin/clang++ -o build/gpick -L/opt/local/libexec/boost/1.81/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 build/source/version/Version.o build/source/gtk/ColorCell.o build/source/gtk/ColorComponent.o build/source/gtk/ColorWheel.o build/source/gtk/ColorWidget.o build/source/gtk/LayoutPreview.o build/source/gtk/Range2D.o build/source/gtk/Shapes.o build/source/gtk/Swatch.o build/source/gtk/Zoomed.o build/source/layout/Box.o build/source/layout/Context.o build/source/layout/Layout.o build/source/layout/Layouts.o build/source/layout/ReferenceCounter.o build/source/layout/Style.o build/source/layout/System.o build/source/i18n/I18N.o build/source/dbus/DbusInterface.o build/source/dbus/Control.o build/source/tools/ColorSpaceSampler.o build/source/tools/PaletteFromImage.o build/source/tools/TextParser.o build/source/lua/Callbacks.o build/source/lua/Color.o build/source/lua/ColorObject.o build/source/lua/DynvSystem.o build/source/lua/Extensions.o build/source/lua/GlobalState.o build/source/lua/I18N.o build/source/lua/Layout.o build/source/lua/Ref.o build/source/lua/Script.o build/source/color_names/ColorNames.o build/source/parser/TextFile.o build/source/parser/TextFileParser.o build/source/dynv/Binary.o build/source/dynv/Map.o build/source/dynv/Types.o build/source/dynv/Variable.o build/source/dynv/Xml.o build/source/common/Format.o build/source/AutoSave.o build/source/BlendColors.o build/source/BrightnessDarkness.o build/source/Clipboard.o build/source/ClosestColors.o build/source/Color.o build/source/ColorList.o build/source/ColorMixer.o build/source/ColorObject.o build/source/ColorPicker.o build/source/ColorRYB.o build/source/ColorSourceManager.o build/source/ColorSpaceType.o build/source/ColorWheelType.o build/source/Converter.o build/source/Converters.o build/source/ErrorCode.o build/source/EventBus.o build/source/FileFormat.o build/source/FloatingPicker.o build/source/GenerateScheme.o build/source/GlobalState.o build/source/HtmlUtils.o build/source/ImportExport.o build/source/LayoutPreview.o build/source/Noise.o build/source/Paths.o build/source/Random.o build/source/RegisterSources.o build/source/Sampler.o build/source/ScreenReader.o build/source/StandardDragDropHandler.o build/source/StandardEventHandler.o build/source/StandardMenu.o build/source/StringUtils.o build/source/ToolColorNaming.o build/source/Variations.o build/source/main.o build/source/uiAbout.o build/source/uiApp.o build/source/uiColorDictionaries.o build/source/uiColorInput.o build/source/uiConverter.o build/source/uiDialogAutonumber.o build/source/uiDialogGenerate.o build/source/uiDialogMix.o build/source/uiDialogOptions.o build/source/uiDialogSort.o build/source/uiDialogVariations.o build/source/uiImportExport.o build/source/uiListPalette.o build/source/uiStatusIcon.o build/source/uiTransformations.o build/source/uiUtilities.o build/source/transformation/Chain.o build/source/transformation/ColorVisionDeficiency.o build/source/transformation/Configuration.o build/source/transformation/Factory.o build/source/transformation/GammaModification.o build/source/transformation/Invert.o build/source/transformation/Quantization.o build/source/transformation/Transformation.o -L/opt/local/lib -L/opt/local/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -llua5.4-c++ -lm -lexpat
Undefined symbols for architecture x86_64:
  "bool dynv::types::xml::write<std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator<bool> > >, 0>(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator<bool> > > const&)", referenced from:
      bool dynv::xml::SerializeVisitor::operator()<bool>(std::__1::vector<bool, std::__1::allocator<bool> > const&) const in Xml.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/gpick] Error 1
scons: building terminated because of errors.
@thezbyg
Copy link
Owner

thezbyg commented Jun 9, 2023

This is fixed by commit f4c8adc in master branch and version 0.3 requires similar changes:

--- source/dynv/Xml.cpp
+++ source/dynv/Xml.cpp
@@ -23,6 +23,7 @@
 #include "common/Scoped.h"
 #include <expat.h>
 #include <sstream>
+#include <type_traits>
 using namespace std::string_literals;
 namespace dynv {
 namespace xml {
@@ -72,7 +73,7 @@
 		using namespace std::string_literals;
 		if (!writeListStart(stream, name, dynv::types::typeHandler<T>().name))
 			return false;
-		for (const auto &i: values) {
+		for (std::conditional_t<std::is_arithmetic_v<T>, T, const T &> i: values) {
 			if (!writeStart(stream, "li"s))
 				return false;
 			if (!types::xml::write(stream, i))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants