ocicuc: Add pthread to LIBS to fix build with GCC 5.1 sandbox/jolfzverb/tizen
authorYury Usishchev <y.usishchev@samsung.com>
Tue, 5 May 2015 08:00:37 +0000 (11:00 +0300)
committerYury Usishchev <y.usishchev@samsung.com>
Tue, 5 May 2015 08:19:07 +0000 (11:19 +0300)
Build with GCC 5.1 failed with error:
[  238s] g++ -o out/tizen/x86/release/resource/examples/ocicuc/monoprocess -s -m32 out/tizen/x86/release/resource/examples/ocicuc/monoprocess.o out/tizen/x86/release/resource/examples/ocicuc/driver.o out/tizen/x86/release/resource/examples/ocicuc/utility.o out/tizen/x86/release/resource/examples/ocicuc/light_resource.o -Lout/tizen/x86/release -L. -loc -loctbstack -lcoap -loc_logger -lboost_program_options
[  238s] /usr/lib/gcc/i586-tizen-linux/5.1/../../../../i586-tizen-linux/bin/ld: out/tizen/x86/release/resource/examples/ocicuc/monoprocess.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'
[  238s] /lib/libpthread.so.0: error adding symbols: DSO missing from command line
[  238s] collect2: error: ld returned 1 exit status

Adding pthread to LIBS fixes the issue

resource/examples/ocicuc/SConscript

index 434efd77612ce59aeef7abdf75d2966fc3d267fc..c86a3e037c2d6fb607808c4de9133288dafee927 100644 (file)
@@ -20,7 +20,7 @@ ocicuc_env.AppendUnique(CPPPATH = [
                ])
 
 ocicuc_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-ocicuc_env.PrependUnique(LIBS = ['oc', 'octbstack', 'coap', 'oc_logger'])
+ocicuc_env.PrependUnique(LIBS = ['oc', 'octbstack', 'coap', 'oc_logger', 'pthread'])
 
 target_os = env.get('TARGET_OS')
 if target_os not in ['windows', 'winrt']: