The following is the problem:<br>root@carlos:/tmp/temp# g++ hello.cc -o hello<br>g++: installation problem, cannot exec &#39;cc1plus&#39;: No such file or directory<br><br>Also there is no make tool in that system...<br><br>
<br><div class="gmail_quote">On Thu, May 24, 2012 at 4:10 PM, Markos Chandras <span dir="ltr">&lt;<a href="mailto:hwoarang@gentoo.org" target="_blank">hwoarang@gentoo.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Thu, May 24, 2012 at 2:58 PM, Marko Košmerl &lt;<a href="mailto:marko06@gmail.com">marko06@gmail.com</a>&gt; wrote:<br>
&gt; On compile time I get warnings:<br>
&gt; watcher.cpp:(.text+0x85): warning: Using &#39;initgroups&#39; in statically linked<br>
&gt; applications requires at runtime the shared libraries from the glibc version<br>
&gt; used for linking<br>
&gt; watcher.cpp:(.text+0x16f): warning: Using &#39;getpwnam&#39; in statically linked<br>
&gt; applications requires at runtime the shared libraries from the glibc version<br>
&gt; used for linking<br>
&gt; client.cpp:(.text+0xb1a): warning: Using &#39;getaddrinfo&#39; in statically linked<br>
&gt; applications requires at runtime the shared libraries from the glibc version<br>
&gt; used for linking<br>
&gt; reg.cpp:(.text+0x3d6): warning: Using &#39;gethostbyname&#39; in statically linked<br>
&gt; applications requires at runtime the shared libraries from the glibc version<br>
&gt; used for linking<br>
&gt;<br>
&gt; On running it:<br>
&gt; ./watcher: /lib/libuuid.so.1: no version information available (required by<br>
&gt; ./watcher)<br>
&gt; ./watcher: /lib/libc.so.6:e version `GLIBC_2.4&#39; not found (required by<br>
&gt; ./watcher)<br>
&gt; ./watcher: /lib/libc.so.6: version `GLIBC_2.7&#39; not found (required by<br>
&gt; ./watcher)<br>
&gt; ./watcher: /lib/libc.so.6: version `GLIBC_2.11&#39; not found (required by<br>
&gt; ./watcher)<br>
&gt;<br>
&gt;<br>
&gt; On Thu, May 24, 2012 at 3:33 PM, Markos Chandras &lt;<a href="mailto:hwoarang@gentoo.org">hwoarang@gentoo.org</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Thu, May 24, 2012 at 2:15 PM, Marko Košmerl &lt;<a href="mailto:marko06@gmail.com">marko06@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Hi!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have some program which I am using in a thin client  which has Gentoo<br>
&gt;&gt; &gt; stage 3 root fs (kernel 2.6.39.4),<br>
&gt;&gt; &gt; lets call it system A.<br>
&gt;&gt; &gt; I&#39;ve also compiled that program chroot-ed in this stage 3 fs from my<br>
&gt;&gt; &gt; personal computer.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have an other thin clients which have older system (B) on it which is<br>
&gt;&gt; &gt; older linux kernel 2.6.16.27.<br>
&gt;&gt; &gt; Library version which are needed are of course different and for that<br>
&gt;&gt; &gt; reason<br>
&gt;&gt; &gt; my program<br>
&gt;&gt; &gt; can not be run in this sistem.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; System A:<br>
&gt;&gt; &gt; Linux redondo 2.6.39.4 #18 Mon Mar 19 13:14:32 CET 2012 i586 i586 i386<br>
&gt;&gt; &gt; GNU/Linux<br>
&gt;&gt; &gt; /lib/<a href="http://libc-2.12.2.so" target="_blank">libc-2.12.2.so</a><br>
&gt;&gt; &gt; gcc version 4.0.3<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; System B:<br>
&gt;&gt; &gt; Linux carlos  2.6.16.27 #1 Sun Mar 25 11:09:40 CEST 2007 i586 i586 i386<br>
&gt;&gt; &gt; GNU/Linux<br>
&gt;&gt; &gt; /lib/<a href="http://libc-2.3.6.so" target="_blank">libc-2.3.6.so</a><br>
&gt;&gt; &gt; gcc version 4.0.3<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Shared libraries that my binary uses are (in system A):<br>
&gt;&gt; &gt; linux-gate.so.1 =&gt;  (0xffffe000)<br>
&gt;&gt; &gt; libpthread.so.0 =&gt; /lib/libpthread.so.0 (0xf76d6000)<br>
&gt;&gt; &gt; libuuid.so.1 =&gt; /lib/libuuid.so.1 (0xf76d1000)<br>
&gt;&gt; &gt; libstdc++.so.6 =&gt; /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libstdc++.so.6<br>
&gt;&gt; &gt; (0xf75da000)<br>
&gt;&gt; &gt; libm.so.6 =&gt; /lib/libm.so.6 (0xf75b2000)<br>
&gt;&gt; &gt; libc.so.6 =&gt; /lib/libc.so.6 (0xf7468000)<br>
&gt;&gt; &gt; /lib/ld-linux.so.2 (0xf76f3000)<br>
&gt;&gt; &gt; libgcc_s.so.1 =&gt; /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libgcc_s.so.1<br>
&gt;&gt; &gt; (0xf7449000)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; If i try to compile my program using &#39;-static&#39; directive, I still have a<br>
&gt;&gt; &gt; problem with 4 functions:<br>
&gt;&gt; &gt; -initgroups,<br>
&gt;&gt; &gt; -getpwnam,<br>
&gt;&gt; &gt; -getaddrinfo,<br>
&gt;&gt; &gt; -gethostbyname.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; If I got that right, they use functions which are located in NSS shared<br>
&gt;&gt; &gt; libraries.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am looking for a way of compiling my program so that I can run it in<br>
&gt;&gt; &gt; system B.<br>
&gt;&gt; &gt; I have libraries available from system B and that is all that I have.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I need help on getting this done.<br>
&gt;&gt; &gt; I guess gcc versions are the same and as well libgcc_s.so.1 shared<br>
&gt;&gt; &gt; library.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; My questions are:<br>
&gt;&gt; &gt; Can I pull those libraries from system B and use it in compilatin<br>
&gt;&gt; &gt; process?<br>
&gt;&gt; &gt; Would that work?<br>
&gt;&gt; &gt; I would still need to get include source files of that version, right?<br>
&gt;&gt; &gt; Is there some archive site where I can find so old version of linux<br>
&gt;&gt; &gt; kernel<br>
&gt;&gt; &gt; source?<br>
&gt;&gt; &gt; One thing that pops in to my mind is also trying to find gentoo stage 3<br>
&gt;&gt; &gt; tarball of the kernel version 2.6.16.27<br>
&gt;&gt; &gt; and compile the program there...I tried to search that but no luck in<br>
&gt;&gt; &gt; that...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Any help would be welcomed!<br>
&gt;&gt;<br>
&gt;&gt; You can statically compile your program on system A ( use gcc -static<br>
&gt;&gt; -o test test.c for example ). Then you should be able to run it in<br>
&gt;&gt; system B without any problem<br>
&gt;&gt;<br>
&gt;<br>
<br>
</div></div>Why don&#39;t you want to compile the program in system B if you already<br>
have the libraries around?<br>
<br>
</blockquote></div><br>