<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem linking with a shared library that uses static library in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-linking-with-a-shared-library-that-uses-static-library/m-p/4784546#M641025</link>
    <description>I'm trying to compile an application with the following configuration&lt;BR /&gt;1. static library lib1.a that contains a function fun1().&lt;BR /&gt;2. static library lib2.a that contains a function fun2() that uses fun1() from lib1.a&lt;BR /&gt;3. shared library libshared.so that contains a function funshared() that uses fun2() from lib2.a&lt;BR /&gt;4. executable that uses libshared.so&lt;BR /&gt;5. I compile the static and shared libraries sources as well as the executable sources with these flags: aCC -c +O3 -w -AA +DD64 -DHP_UX -D_USE_BIG_FDS -mt&lt;BR /&gt;6. I create the static with these flags: ar cr&lt;BR /&gt;7. I create the shared library with these flags: aCC -b libshared.so -llib1.a -llib2.a&lt;BR /&gt;8. I create the executable with these flags: aCC +O3 -w -AA +DD64 -DHP_UX -D_USE_BIG_FDS -mt libshared.so&lt;BR /&gt;The problem is that i get this error ld: (Warning) Unsatisfied symbol "func1()" while creating the executable. The problem is solved when i include both lib1.a and lib2.a in the linking of the executable like this: aCC +O3 -w -AA +DD64 -DHP_UX -D_USE_BIG_FDS -mt libshared.so -llib1.a -llib2.a&lt;BR /&gt;but i think i don't have to include the static libraries in the linking as i already did when building the shared library. Is there any other way i can resolve this warning.&lt;BR /&gt;</description>
    <pubDate>Thu, 05 May 2011 07:34:39 GMT</pubDate>
    <dc:creator>Walid Fouad</dc:creator>
    <dc:date>2011-05-05T07:34:39Z</dc:date>
    <item>
      <title>Problem linking with a shared library that uses static library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-linking-with-a-shared-library-that-uses-static-library/m-p/4784546#M641025</link>
      <description>I'm trying to compile an application with the following configuration&lt;BR /&gt;1. static library lib1.a that contains a function fun1().&lt;BR /&gt;2. static library lib2.a that contains a function fun2() that uses fun1() from lib1.a&lt;BR /&gt;3. shared library libshared.so that contains a function funshared() that uses fun2() from lib2.a&lt;BR /&gt;4. executable that uses libshared.so&lt;BR /&gt;5. I compile the static and shared libraries sources as well as the executable sources with these flags: aCC -c +O3 -w -AA +DD64 -DHP_UX -D_USE_BIG_FDS -mt&lt;BR /&gt;6. I create the static with these flags: ar cr&lt;BR /&gt;7. I create the shared library with these flags: aCC -b libshared.so -llib1.a -llib2.a&lt;BR /&gt;8. I create the executable with these flags: aCC +O3 -w -AA +DD64 -DHP_UX -D_USE_BIG_FDS -mt libshared.so&lt;BR /&gt;The problem is that i get this error ld: (Warning) Unsatisfied symbol "func1()" while creating the executable. The problem is solved when i include both lib1.a and lib2.a in the linking of the executable like this: aCC +O3 -w -AA +DD64 -DHP_UX -D_USE_BIG_FDS -mt libshared.so -llib1.a -llib2.a&lt;BR /&gt;but i think i don't have to include the static libraries in the linking as i already did when building the shared library. Is there any other way i can resolve this warning.&lt;BR /&gt;</description>
      <pubDate>Thu, 05 May 2011 07:34:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-linking-with-a-shared-library-that-uses-static-library/m-p/4784546#M641025</guid>
      <dc:creator>Walid Fouad</dc:creator>
      <dc:date>2011-05-05T07:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem linking with a shared library that uses static library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-linking-with-a-shared-library-that-uses-static-library/m-p/4784547#M641026</link>
      <description>&amp;gt;1. static library lib1.a that contains a function fun1().&lt;BR /&gt;&lt;BR /&gt;(A terminology note:  These are archive libs, not static.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;3. shared library libshared.so that contains a function funshared() that uses fun2() from lib2.a&lt;BR /&gt;&amp;gt;7. I create the shared library with these flags: aCC -b libshared.so -llib1.a -llib2.a&lt;BR /&gt;&lt;BR /&gt;Are fun2 and fun1 in libshared.so?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;aCC -c +O3 -w -AA +DD64&lt;BR /&gt;&lt;BR /&gt;I would suggest you leave off +O3 until you get things working.  Also never use -w, instead add +W#### to suppress individual warnings.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I think I don't have to include the static libraries in the linking as I already did when building the shared library.&lt;BR /&gt;&lt;BR /&gt;Check to see if you have those functions in your shlib:&lt;BR /&gt;elfdump -n .dynsym -s libshared.so |&lt;BR /&gt;  grep -e fun1 -e fun2&lt;BR /&gt;&lt;BR /&gt;Make sure these symbols are mangled to match the symbol in your warning.  And are being exported.&lt;BR /&gt;&lt;BR /&gt;If not in your shlib, you need to force them there.</description>
      <pubDate>Fri, 06 May 2011 08:26:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-linking-with-a-shared-library-that-uses-static-library/m-p/4784547#M641026</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-05-06T08:26:35Z</dc:date>
    </item>
  </channel>
</rss>

