Reorder library link order for mqttclient to address link error.
authorOssama Othman <ossama.othman@intel.com>
Mon, 23 Feb 2015 18:34:20 +0000 (10:34 -0800)
committerSudarshan Prasad <sudarshan.prasad@intel.com>
Fri, 27 Feb 2015 09:15:15 +0000 (09:15 +0000)
An unresolved symbol error for pthread_create() occurred during the
Linux mqttclient sample app link phase.  Move the pthread library to
end of the linker command line so that the missing symbol can be
resolved for libraries that depend on it.

Generally, libraries that depend on specific libraries should appear
earlier in the linker command line. For example, if libfoo depends on
libpthread, the library command line should look something like:

  g++ bar.c -lfoo -lpthread

This doesn't matter as much for dynamically linked libraries since the
inter-library dependency is embedded into the shared library itself,
but order does matter when statically linking.

Change-Id: I6ac40dde39930501458e16624052ab934503e27f
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/398
Reviewed-by: Erich Keane <erich.keane@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
service/protocol-plugin/sample-app/linux/SConscript

index d4ee8dd..17359ad 100644 (file)
@@ -20,8 +20,9 @@ sample_env.AppendUnique(CPPPATH = [
 if target_os not in ['windows', 'winrt']:
        sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-pthread'])
 
-sample_env.AppendUnique(LIBS = ['pthread'])
 sample_env.AppendUnique(LIBS = ['oc', 'oc_logger', 'octbstack', 'coap', 'ppm', 'pmimpl', 'boost_system', 'boost_thread', 'dl'])
+sample_env.AppendUnique(LIBS = ['pthread'])
+
 ######################################################################
 # Source files and Targets
 ######################################################################