<?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 Re: Managing Shared Libraries in Makefile in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127877#M93070</link>
    <description>You didn't mention specifically if you were on PA or IPF.  On PA you should name your shibs as .sl, not .so.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;LINKLIB = ../../libStringTokenizer.so \ ...&lt;BR /&gt;&lt;BR /&gt;The proper way to do this is with -L &amp;amp; -l:&lt;BR /&gt;LINKLIB = -L../../WorkSpace -lStringTokenizer \&lt;BR /&gt;-lStringToNumericals -lbvfWriter \&lt;BR /&gt;-lReadRawData -lReadLayoutData -lz&lt;BR /&gt;&lt;BR /&gt;(The -l option requires .sl for PA.)&lt;BR /&gt;If you don't use -l, then +s and +b don't work, without additional chatr(1) magic.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;test -d $(TARGETDIR) || mkdir -p $(TARGETDIR)&lt;BR /&gt;&lt;BR /&gt;No need for test, just do "mkdir -p".</description>
    <pubDate>Sun, 13 Jan 2008 02:02:58 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-01-13T02:02:58Z</dc:date>
    <item>
      <title>Managing Shared Libraries in Makefile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127874#M93067</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have the following problem while linking the shared library. can some one help me to solve this problem.&lt;BR /&gt;&lt;BR /&gt;The Directory structure for my project is as below&lt;BR /&gt;&lt;BR /&gt;MAIN - &lt;BR /&gt;WorkSpace - &lt;BR /&gt;DIR1 - Src&lt;BR /&gt;Hdr&lt;BR /&gt;lib&lt;BR /&gt;obj&lt;BR /&gt;DIR2 - Src&lt;BR /&gt;Hdr&lt;BR /&gt;lib&lt;BR /&gt;obj&lt;BR /&gt;DIR3 -Src&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;Workspace is the directory where i am copying all the shared libraries and the executable. My main function is present in DIR3/Src&lt;BR /&gt;&lt;BR /&gt;So initillay i generated the shared libraries for each DIRs in their respective lib directories and copied it to WorkSpace in the Makefile of each directory&lt;BR /&gt;&lt;BR /&gt;Now while generating the executable, in DIR3/Src/Makefile i i have specified to take the libraries present in the &lt;BR /&gt;../../WorkSpace&lt;BR /&gt;&lt;BR /&gt;But, I am getting &lt;BR /&gt;ld errors because the compiler is not getting the Path. But if i give &lt;BR /&gt;/home/Vikram/MAIN/WorkSpace, it works.&lt;BR /&gt;&lt;BR /&gt;Can any one help me to solve this problem.&lt;BR /&gt;&lt;BR /&gt;Also, if i hard core the paths like this can i use the executable generated in WorkSpace as a standaloner in some other Machine.&lt;BR /&gt;&lt;BR /&gt;thanks and regards&lt;BR /&gt;Vikram</description>
      <pubDate>Fri, 11 Jan 2008 13:09:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127874#M93067</guid>
      <dc:creator>CA1490051</dc:creator>
      <dc:date>2008-01-11T13:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Managing Shared Libraries in Makefile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127875#M93068</link>
      <description>This is related to your makefile questions.&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1192611" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1192611&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The directory structure for my project is as below&lt;BR /&gt;&lt;BR /&gt;(You can't rely on spacing here unless you check the box.  So you should list the full paths for each line.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I am getting ld errors because the compiler is not getting the Path. &lt;BR /&gt;&lt;BR /&gt;No compilers are involved.  Just ld.&lt;BR /&gt;Are you using -L with the correct relative path?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;if i hard code the paths like this, can I use the executable generated in WorkSpace as a standaloner in some other Machine.&lt;BR /&gt;&lt;BR /&gt;Yes, there are several options.&lt;BR /&gt;You can use -Wl,+b,path-list to embed the location at runtime.&lt;BR /&gt;You can use -Wl,+s so that dld can honor SHLIB_PATH or LD_LIBRARY_PATH at runtime.&lt;BR /&gt;&lt;BR /&gt;For newer linkers, you can also use $ORIGIN in the paths to it is relative to the executable.</description>
      <pubDate>Sat, 12 Jan 2008 05:09:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127875#M93068</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-01-12T05:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Managing Shared Libraries in Makefile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127876#M93069</link>
      <description>Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;   Yes, i have given the correct Path and i also displayed the contetnt of the WorkSpace Directory where all the libraries are present. &lt;BR /&gt;&lt;BR /&gt;    Still the linker will complain about the ld errorrs&lt;BR /&gt;&lt;BR /&gt;   But, I am able to compile now by setting the SHLIB_PATH to the workSpace directory.&lt;BR /&gt;  &lt;BR /&gt;   Please find the sample of  Makefile attached which i am using in the DIR3/Src/Makefile.&lt;BR /&gt;&lt;BR /&gt;LINKLIB             = ../../libStringTokenizer.so \&lt;BR /&gt;                      ../../libStringToNumericals.so \&lt;BR /&gt;                      ../../libbvfWriter.so \&lt;BR /&gt;        ../../libReadRawData.so \&lt;BR /&gt;                      ../../libReadLayoutData.so \&lt;BR /&gt;                      ../../libz.sl &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$(TARGET) : ProberData ReadProberData.cpp wcBvfWriter.cpp&lt;BR /&gt;  test -d $(TARGETDIR) || mkdir -p $(TARGETDIR)&lt;BR /&gt;  pwd; ls ../../WorkSpace ; $(CXX) -o $@ $(INCPATH) ReadProberData.cpp wcBvfWriter.cpp $(LINKLIB);pwd; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks and regards&lt;BR /&gt;Vikram&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Jan 2008 12:17:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127876#M93069</guid>
      <dc:creator>CA1490051</dc:creator>
      <dc:date>2008-01-12T12:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Managing Shared Libraries in Makefile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127877#M93070</link>
      <description>You didn't mention specifically if you were on PA or IPF.  On PA you should name your shibs as .sl, not .so.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;LINKLIB = ../../libStringTokenizer.so \ ...&lt;BR /&gt;&lt;BR /&gt;The proper way to do this is with -L &amp;amp; -l:&lt;BR /&gt;LINKLIB = -L../../WorkSpace -lStringTokenizer \&lt;BR /&gt;-lStringToNumericals -lbvfWriter \&lt;BR /&gt;-lReadRawData -lReadLayoutData -lz&lt;BR /&gt;&lt;BR /&gt;(The -l option requires .sl for PA.)&lt;BR /&gt;If you don't use -l, then +s and +b don't work, without additional chatr(1) magic.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;test -d $(TARGETDIR) || mkdir -p $(TARGETDIR)&lt;BR /&gt;&lt;BR /&gt;No need for test, just do "mkdir -p".</description>
      <pubDate>Sun, 13 Jan 2008 02:02:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/managing-shared-libraries-in-makefile/m-p/4127877#M93070</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-01-13T02:02:58Z</dc:date>
    </item>
  </channel>
</rss>

