<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2809401172949895666</id><updated>2012-02-16T10:33:29.692+04:00</updated><category term='linux'/><category term='qt'/><title type='text'>codea-dev</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codea-dev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809401172949895666/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codea-dev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Alex Mordovin</name><uri>http://www.blogger.com/profile/15650498575162680504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2809401172949895666.post-7170270892993014335</id><published>2010-12-15T14:02:00.001+03:00</published><updated>2010-12-15T14:04:59.050+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='qt'/><title type='text'>Qmake, RPATH and evil $ORIGIN</title><content type='html'>This is a quick guide how to deploy a set of private libraries with your Qt application on Linux using RPATH.&lt;br /&gt;&lt;br /&gt;Some will find LD_LIBRARY_PATH variable usefull, but it can become a real pain (e.g, if you need to elevate your process).&lt;br /&gt;&lt;br /&gt;A better and more reliable solution is to tell compiler about libraries locations at link time using -rpath key, like this: &lt;br /&gt;&lt;blockquote&gt;-Wl,-rpath,/some/path/to/lib&lt;/blockquote&gt;There is also a way to set a path relative to a location of an executable by using $ORIGIN key-word.&lt;br /&gt;&lt;blockquote&gt;-Wl,-rpath,'$ORIGIN/../mylibs'&lt;/blockquote&gt;You might think: "This is perfect!" but problems are not over yet. If you're using qmake pro file to build a project then you need to path $ORIGIN keyword all the way down to compiler arguments through: first qmake pro file processor and then Makefile processor. Use this solution to avoid the string being interpreted at any step.&lt;br /&gt;&lt;blockquote&gt;QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/../mylibs\''&amp;nbsp;&lt;/blockquote&gt;Qmake provides QMAKE_RPATHDIR variable for defining a set of pathes. But it won't work with a path containing $ORIGIN as it will resolve it no matter how far away you hide it. Use QMAKE_LFLAGS instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809401172949895666-7170270892993014335?l=codea-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codea-dev.blogspot.com/feeds/7170270892993014335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codea-dev.blogspot.com/2010/12/qmake-rpath-and-evil-origin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809401172949895666/posts/default/7170270892993014335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809401172949895666/posts/default/7170270892993014335'/><link rel='alternate' type='text/html' href='http://codea-dev.blogspot.com/2010/12/qmake-rpath-and-evil-origin.html' title='Qmake, RPATH and evil $ORIGIN'/><author><name>Alex Mordovin</name><uri>http://www.blogger.com/profile/15650498575162680504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
