From: Uwe Hermann Date: Mon, 26 Jan 2015 14:26:15 +0000 (+0100) Subject: cxx: Fix a linking issue. X-Git-Tag: libsigrok-0.4.0~671 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=dc7125bb7cfe34f63695ea928dda17594dfac3d2;p=libsigrok.git cxx: Fix a linking issue. Fix "undefined reference to `sigrok::EnumValue::_values'", which happens at least when using clang(++), e.g. on Linux, Mac OS X, or FreeBSD. This fixes bug #534. Thanks to Uffe Jakobsen and Martin Ling for reporting and investigating! --- diff --git a/bindings/cxx/enums.py b/bindings/cxx/enums.py index 53bd000d..aed42120 100644 --- a/bindings/cxx/enums.py +++ b/bindings/cxx/enums.py @@ -138,7 +138,7 @@ for enum, (classname, classbrief) in classes.items(): file=code) # Define map of enum values to constants - print('template<> const std::map EnumValue<%s, enum %s>::_values = {' % ( + print('template<> const SR_API std::map EnumValue<%s, enum %s>::_values = {' % ( enum_name, classname, classname, enum_name), file=code) for name, trimmed_name in zip(member_names, trimmed_names): print('\t{%s, %s::%s},' % (name, classname, trimmed_name), file=code)