<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>How to link staticly must-run everywhere Linux executable ELF</title>
		<link>http://www.allegro.cc/forums/view/472720</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 24 Mar 2005 15:15:24 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How can I build a proram so that it will run on almost every Linux?<br />I thought I should use `allegro-config --libs --static` and --static for the linker, but I dont work, in example:</p><p>g++ alien_main.o alien_seed1.o [...] test_a.o -lm `allegro-config --libs --static` -o alien.linux.i386.static.elf --static</p><p>/usr/local/lib/liballeg.a(umodules.o)(.text+0x1d9): In function `_unix_load_modules&#39;:<br />: warning: Using &#39;dlopen&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/local/lib/liballeg.a(file.o)(.text+0x5be): In function `canonicalize_filename&#39;:<br />: warning: Using &#39;getpwent&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/local/lib/liballeg.a(file.o)(.text+0x5b9): In function `canonicalize_filename&#39;:<br />: warning: Using &#39;setpwent&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/local/lib/liballeg.a(file.o)(.text+0x5fe): In function `canonicalize_filename&#39;:<br />: warning: Using &#39;endpwent&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/X11R6/lib/libX11.a(GetDflt.o)(.text+0x9a): In function `GetHomeDir&#39;:<br />: warning: Using &#39;getpwnam_r&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/X11R6/lib/libX11.a(GetDflt.o)(.text+0xea): In function `GetHomeDir&#39;:<br />: warning: Using &#39;getpwuid_r&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/X11R6/lib/libX11.a(x11trans.o)(.text+0x995): In function `_X11TransSocketINETConnect&#39;:<br />: warning: Using &#39;gethostbyname&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/X11R6/lib/libX11.a(x11trans.o)(.text+0x76a): In function `_X11TransSocketINETConnect&#39;:<br />: warning: Using &#39;getservbyname&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking<br />/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libXcursor.a(cursor.o)(.text+0xe26): In function `XcursorImageLoadCursor&#39;:</p><p>: undefined reference to `XRenderFindStandardFormat&#39;<br />/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libXcursor.a(cursor.o)(.text+0xe45): In function `XcursorImageLoadCursor&#39;:<br />: undefined reference to `XRenderCreatePicture&#39;<br />/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libXcursor.a(cursor.o)(.text+0xe73): In function `XcursorImageLoadCursor&#39;:<br />: undefined reference to `XRenderCreateCursor&#39;<br />/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libXcursor.a(cursor.o)(.text+0xe84): In function `XcursorImageLoadCursor&#39;:<br />: undefined reference to `XRenderFreePicture&#39;<br />/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libXcursor.a(cursor.o)(.text+0x131a): In function `XcursorImagesLoadCursor&#39;:<br />: undefined reference to `XRenderCreateAnimCursor&#39;<br />/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libXcursor.a(display.o)(.text+0x210): In function `_XcursorGetDisplayInfo&#39;:<br />: undefined reference to `XRenderQueryExtension&#39;<br />/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libXcursor.a(display.o)(.text+0x57d): In function `_XcursorGetDisplayInfo&#39;:<br />: undefined reference to `XRenderQueryVersion&#39;</p><p>collect2: ld returned 1 exit status<br />make: *** [alien.linux.i386.static.elf] Error 1<br />raf256@worf:~/cre/cpp/p00375_alien/src/c$</p><p>What can I do about it? What if I would need to use allegroGL and GL, GLUT libraries?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raf256)</author>
		<pubDate>Wed, 23 Mar 2005 09:29:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>How can I build a proram so that it will run on almost every Linux?</p></div></div><p>
Distribute source.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>warning: Using &#39;dlopen&#39; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking</p></div></div><p>
I&#39;ve never actually seen this produce a problem when the program is run. I think you need to disable modules in Allegro to get rid of this.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>undefined reference to `XRenderFindStandardFormat&#39;</p></div></div><p>
You need to bring in an extra library for the linker. I think you can do ldd /usr/lib/libXcursor.a and cross-reference with the output of allegro-config --libs to see which one you need to link in.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Wed, 23 Mar 2005 15:23:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It looks like it wants the XRender lib.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 23 Mar 2005 15:26:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think the last --static on the command line should be -static. That causes even dynamic libraries to be static-linked. However, shared libraries that are themselves dynamic linked with other libs may need to have those extra libs explicitly specified.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Wed, 23 Mar 2005 15:27:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well I can not give the source,<br />- closed-source commercial application<br />- not everyone have time to recompiles, its not lny by programmers - for programmers program <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>I will play with that link options... how to disable modules in Allegro compilation?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raf256)</author>
		<pubDate>Thu, 24 Mar 2005 11:03:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>- not everyone have time to recompiles, its not lny by programmers - for programmers program <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p></div></div><p>
No, but if you were to release source then others could contribute compiled versions for different distributions. Distributions might even ship the compiled version. Of course, they probably won&#39;t if it&#39;s a commercial project.<br />By the way, `open source&#39; in no way contradicts `commercial&#39;</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I will play with that link options... how to disable modules in Allegro compilation?</p></div></div><p>
Check the configure options (./configure --help). I think it&#39;s something like --disable-modules.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Thu, 24 Mar 2005 15:15:24 +0000</pubDate>
	</item>
</rss>
