From 21335a970f7eee472cc65f152ff7e1ed1e0914d0 Mon Sep 17 00:00:00 2001 From: "E. Souhrada" Date: Thu, 17 May 2018 11:06:11 -0700 Subject: [PATCH 1/2] resolve a missing symbol error under ubuntu 16 On ubuntu 16, and possibly newer, this error occurs when doing a static build. undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE Add -lstdc++ to the libraries to resolve. Code remains functional under older versions. --- setup_posix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_posix.py b/setup_posix.py index 6630a115..3fe56865 100644 --- a/setup_posix.py +++ b/setup_posix.py @@ -83,6 +83,7 @@ def get_config(): break if static: + libraries.append('stdc++') extra_objects.append(os.path.join(library_dirs[0], 'lib%s.a' % client)) if client in libraries: libraries.remove(client) From 4aeb4a827af626426ba17fc6829219b0ce3564d8 Mon Sep 17 00:00:00 2001 From: "E. Souhrada" Date: Thu, 17 May 2018 18:02:02 -0700 Subject: [PATCH 2/2] change from using 'libraries' to 'language' for static builds to get the appropriate libstdc++ or equivalent linked in. setting language = 'c++' for non-static builds appears to have no ill effect but we will do it this way to keep the number and complexity of changes to a minimum. --- setup_posix.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup_posix.py b/setup_posix.py index 3fe56865..6e409609 100644 --- a/setup_posix.py +++ b/setup_posix.py @@ -83,7 +83,6 @@ def get_config(): break if static: - libraries.append('stdc++') extra_objects.append(os.path.join(library_dirs[0], 'lib%s.a' % client)) if client in libraries: libraries.remove(client) @@ -109,6 +108,11 @@ def get_config(): extra_objects = extra_objects, define_macros = define_macros, ) + + # newer versions of gcc require libstdc++ if doing a static build + if static: + ext_options['language'] = 'c++' + return metadata, ext_options if __name__ == "__main__":