<?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: Linking C++ program to a C++ library in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020086#M65239</link>
    <description>Thanks; you nailed it !!&lt;BR /&gt;&lt;BR /&gt;The .h includes are located in /usr/include/mysql&lt;BR /&gt;&lt;BR /&gt;I used quotes instead of the left and right brackets and it worked !!&lt;BR /&gt;&lt;BR /&gt;#include "/usr/include/mysql/mysql.h"&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 22 Dec 2006 10:30:08 GMT</pubDate>
    <dc:creator>Vernon Brown_4</dc:creator>
    <dc:date>2006-12-22T10:30:08Z</dc:date>
    <item>
      <title>Linking C++ program to a C++ library</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020083#M65236</link>
      <description>I'm writing a simple little C++ program to act as a driver between a web browser and a MySQL database. This script compiles the program without error, but calls to MySQL functions fail, indicating that the MySQL client library is not linked.&lt;BR /&gt; &lt;BR /&gt;g++ admacct.cpp  /usr/lib64/mysql/libmysqlclient_r.so.15&lt;BR /&gt;&lt;BR /&gt;mv a.out /var/www/cgi-bin/admacct.cgi&lt;BR /&gt;&lt;BR /&gt;Does anyone have a clue about how to set up the include path for compiling C++ programs. I'm searching the documentation at:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dev.mysql.com/doc/refman/5.1/en/index.html" target="_blank"&gt;http://dev.mysql.com/doc/refman/5.1/en/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Any clue greatly appriciated.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Dec 2006 15:40:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020083#M65236</guid>
      <dc:creator>Vernon Brown_4</dc:creator>
      <dc:date>2006-12-21T15:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Linking C++ program to a C++ library</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020084#M65237</link>
      <description>Follow up: I think I only have to find out what goes into the #Include &amp;lt;....&amp;gt; statement. So far I've tried every combination of:&lt;BR /&gt;#Include &lt;MYSQL&gt;&lt;BR /&gt;that I can guess. I have not been able to find any of the source files for mysql clients. I'm sure these would all have that include statement in them.&lt;/MYSQL&gt;</description>
      <pubDate>Fri, 22 Dec 2006 09:21:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020084#M65237</guid>
      <dc:creator>Vernon Brown_4</dc:creator>
      <dc:date>2006-12-22T09:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Linking C++ program to a C++ library</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020085#M65238</link>
      <description>Tou're best off using the mysql_config script to get the compile and link flags you need. The MySQL documentation talks about that in the section on compiling clients for the C API.&lt;BR /&gt;&lt;BR /&gt;That's not the right syntax to link against a shared library, though it probably should work. You should use "-lmysqlclient_r", but you probably also need a "-lz" and possibly a few others.&lt;BR /&gt;&lt;BR /&gt;Assuming that you're using the standard MySQL client library, the include file you want is probably mysql.h, but it might be under /usr/include/mysql instead of just /usr/include.&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Dec 2006 09:53:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020085#M65238</guid>
      <dc:creator>Heironimus</dc:creator>
      <dc:date>2006-12-22T09:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Linking C++ program to a C++ library</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020086#M65239</link>
      <description>Thanks; you nailed it !!&lt;BR /&gt;&lt;BR /&gt;The .h includes are located in /usr/include/mysql&lt;BR /&gt;&lt;BR /&gt;I used quotes instead of the left and right brackets and it worked !!&lt;BR /&gt;&lt;BR /&gt;#include "/usr/include/mysql/mysql.h"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Dec 2006 10:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020086#M65239</guid>
      <dc:creator>Vernon Brown_4</dc:creator>
      <dc:date>2006-12-22T10:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Linking C++ program to a C++ library</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020087#M65240</link>
      <description>Problem solved</description>
      <pubDate>Fri, 22 Dec 2006 10:31:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linking-c-program-to-a-c-library/m-p/5020087#M65240</guid>
      <dc:creator>Vernon Brown_4</dc:creator>
      <dc:date>2006-12-22T10:31:47Z</dc:date>
    </item>
  </channel>
</rss>

