<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib]]></title><description><![CDATA[<p>Hi,</p>
<p>i want to use an icq library to make a small program to control the pc with messages using icq. So i need to use icq librarys. I found very good ones, but i dont want to use the source files directly with my project. I compiled the librarys and installed them to /usr/local/lib. Here i have the following files :</p>
<p>libicq.a <a href="http://libicq.la" rel="nofollow">libicq.la</a> <a href="http://libicq.so" rel="nofollow">libicq.so</a> libicq.so.1 libicq.so.1.0.0</p>
<p>They include all the important featues that are needed to communicate with icq.</p>
<p>But how can i use them into my C or C++ program? It must be possible, because other programs written in c also include compiled systemlibrarys, but i didnt find anything about that searching google.<br />
The libs itselfs are written in C.</p>
<p>Please help me <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Thx, Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/120357/linux-c-include-librarys-in-usr-local-lib</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 07:33:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/120357.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Sep 2005 13:38:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 13:38:20 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>i want to use an icq library to make a small program to control the pc with messages using icq. So i need to use icq librarys. I found very good ones, but i dont want to use the source files directly with my project. I compiled the librarys and installed them to /usr/local/lib. Here i have the following files :</p>
<p>libicq.a <a href="http://libicq.la" rel="nofollow">libicq.la</a> <a href="http://libicq.so" rel="nofollow">libicq.so</a> libicq.so.1 libicq.so.1.0.0</p>
<p>They include all the important featues that are needed to communicate with icq.</p>
<p>But how can i use them into my C or C++ program? It must be possible, because other programs written in c also include compiled systemlibrarys, but i didnt find anything about that searching google.<br />
The libs itselfs are written in C.</p>
<p>Please help me <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Thx, Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/post/870280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870280</guid><dc:creator><![CDATA[alexb83]]></dc:creator><pubDate>Mon, 12 Sep 2005 13:38:20 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 13:45:15 GMT]]></title><description><![CDATA[<p>well do you compile and link at the command line or do you use an IDE ?<br />
If you use an IDE , which one ?<br />
otherwise just add the lib in you linking step.</p>
<p>example :<br />
g++ filename.cpp -o objectname -licq<br />
or if you have already compiled your source into an object file , then do smth like this<br />
g++ filname.o -o objectname -licq</p>
<p>(this are c++ examples but c goes the same way)</p>
<p>//edit<br />
I hope thats what you asked for</p>
]]></description><link>https://www.c-plusplus.net/forum/post/870287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870287</guid><dc:creator><![CDATA[shapeless]]></dc:creator><pubDate>Mon, 12 Sep 2005 13:45:15 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 14:01:09 GMT]]></title><description><![CDATA[<p>Hi, thx for the response <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>But the problem is, that i want to use the methods declared in the library, e.g connect_icq() or something like that.</p>
<p>If i try it like you told me, he cant use any of the functions. I also have to include them in the .cpp file directly. Is there any way?</p>
<p>Also if i compile it with -o <a href="http://libfile.so" rel="nofollow">libfile.so</a> -licq he makes no executable. Also another question.. what does the -licq mean?</p>
<p>Do i have to create a headerfile that referes to the library so that he knows the method?</p>
<p>Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/post/870302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870302</guid><dc:creator><![CDATA[alexb83]]></dc:creator><pubDate>Mon, 12 Sep 2005 14:01:09 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 14:15:43 GMT]]></title><description><![CDATA[<p>Yes you have to include the headerfiles in your sourcefile.<br />
But if you have compiled the icq-source files into a lib you have to use this lib during the linking process to bild the binary ( executable).</p>
<p>example sourcefile:</p>
<p>#include&lt;icq.h&gt;// i do not know the name of the file you have to include for your function but i hope you know it<br />
#include&lt;whatever&gt;<br />
[...]<br />
somewhere<br />
icq_connect(params);<br />
---</p>
<p>end of file.</p>
<pre><code>now you can compile this file. and after the compiling process you have to link the object to get the binary.
You can do both steps in one with gcc (c++)

g++ file.cpp -o binaryname -licq
^-----^-------------^--------^---
|     |             |        |
|     |             |     use the libicq.so(e.g.)form you lib path(e.g. /usr/lib)           |
|     |             the name of your binary    
|     the file that includes the icq.h or whatever the name is
your compiler
</code></pre>
<p>well use gcc file.c -o binaryname -licq if you have written C code.</p>
<p>I hope the use of -licq has become clear.<br />
well, what is your error message? what happens if you compile or link the file?<br />
Error masseges are welcome <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/870311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870311</guid><dc:creator><![CDATA[shapeless]]></dc:creator><pubDate>Mon, 12 Sep 2005 14:15:43 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 14:23:03 GMT]]></title><description><![CDATA[<p>thx.. i have overwritten the lib the first time, because i did g++ mytest.cpp -o libfile -licq <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /></p>
<p>was a bit wrong, but now it works... i made it the standart way i knew it putting the lib in front of the -o, but also works in your way <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> but thx for the graphical advice <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>But as you already advised.. there is an error <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>./licq: error while loading shared libraries: libicq.so.1: cannot open shared object file: No such file or directory</p>
<p>(i called my binary licq now <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> )</p>
<p>Why does he search for libicq.so.1? Why cant he find it because its like the libfile in the same folder in the same directory where the mytest.cpp is located.</p>
<p>I hope you can help me again <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/870319</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870319</guid><dc:creator><![CDATA[alexb83]]></dc:creator><pubDate>Mon, 12 Sep 2005 14:23:03 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 14:34:58 GMT]]></title><description><![CDATA[<p>alexb83 schrieb:</p>
<blockquote>
<p>Why does he search for libicq.so.1?</p>
</blockquote>
<p>he want to use the functions from the library <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> (like connect_icq(); )</p>
<p>alexb83 schrieb:</p>
<blockquote>
<p>Why cant he find it because its like the libfile in the same folder in the same directory where the mytest.cpp is located.</p>
</blockquote>
<p>the library must be in /usr/lib/ or /usr/local/lib</p>
<p>alexb83 schrieb:</p>
<blockquote>
<p>(i called my binary licq now <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> )</p>
</blockquote>
<p>not a good idea</p>
]]></description><link>https://www.c-plusplus.net/forum/post/870337</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870337</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 12 Sep 2005 14:34:58 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 14:45:31 GMT]]></title><description><![CDATA[<p>he found the functions i think... as i compiled it without -o and the .sofile only with the headerfile the error &quot;undefined reference to connect_icq&quot; occurs, but as i added the .so file the error was gone.</p>
<p>they are in these folders (copied them to both) but it doesnt find them (i deleted them from my homefolder). I also tried -l</p>
<p>I changed it to icqprog <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/870344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870344</guid><dc:creator><![CDATA[alexb83]]></dc:creator><pubDate>Mon, 12 Sep 2005 14:45:31 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 15:06:00 GMT]]></title><description><![CDATA[<p>alexb83 schrieb:</p>
<blockquote>
<p>./licq: error while loading shared libraries: libicq.so.1: cannot open shared object file: No such file or directory</p>
<p>(i called my binary licq now <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> )</p>
<p>Why does he search for libicq.so.1?</p>
</blockquote>
<p>Well when you linked with the switch -licq you told the linker in your system's default lib directory is a lib named libicq.so.1..<br />
well it looks it up and so it has to be in you lib directory.<br />
e.g this is /usr/lib/ or /usr/local/lib<br />
If your lib is in that directorx please also check the read permissions</p>
]]></description><link>https://www.c-plusplus.net/forum/post/870360</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870360</guid><dc:creator><![CDATA[shapeless]]></dc:creator><pubDate>Mon, 12 Sep 2005 15:06:00 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 15:18:03 GMT]]></title><description><![CDATA[<p>rights are ok... i should work...</p>
<p>also tried something like</p>
<p>g++ -L/usr/local/lib/ mytest.cpp -o icqprog -l /usr/local/lib/libicq.so</p>
<p>or</p>
<p>g++ -L/usr/local/lib/ mytest.cpp -o icqprog -l <a href="http://libicq.so" rel="nofollow">libicq.so</a></p>
<p>but always an error like:</p>
<p>/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: cannot find -l/usr/local/lib/libicq.so<br />
collect2: ld returned 1 exit status</p>
]]></description><link>https://www.c-plusplus.net/forum/post/870370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870370</guid><dc:creator><![CDATA[alexb83]]></dc:creator><pubDate>Mon, 12 Sep 2005 15:18:03 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 15:29:15 GMT]]></title><description><![CDATA[<p>Well, in my humble opinion you just need a readable libicq.so.1 within the /usr/local/lib<br />
directory and link it with<br />
gcc mytest.cpp -o icqprog -licq</p>
<p>If that doesnt work i also dont know, because i am not gcc and linking pro .sry</p>
]]></description><link>https://www.c-plusplus.net/forum/post/870376</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870376</guid><dc:creator><![CDATA[shapeless]]></dc:creator><pubDate>Mon, 12 Sep 2005 15:29:15 GMT</pubDate></item><item><title><![CDATA[Reply to Linux: c++ include librarys in &#x2F;usr&#x2F;local&#x2F;lib on Mon, 12 Sep 2005 15:48:25 GMT]]></title><description><![CDATA[<p>i got it workin... didnt get it, that -llib adds <a href="http://icq.so" rel="nofollow">icq.so</a> automaticly...</p>
<p>now it works... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>thx very much <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/870403</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/870403</guid><dc:creator><![CDATA[alexb83]]></dc:creator><pubDate>Mon, 12 Sep 2005 15:48:25 GMT</pubDate></item></channel></rss>