title: libssh2 and C++
body: <p>When I try to use libssh2 in my C++ class, I keep getting the following errors:</p>
  
  <pre>
  undefined reference to `libssh2_session_init_ex'
  undefined reference to `libssh2_session_startup'
  </pre>
  
  <p>If I do the same thing using C, everything works fine.</p>
  
  <p>Any help?</p>
  
  <p>Following is the build command</p>
  
  <pre><code>g++ -Wall -g -I/libssh2-1.2.4/src -I/libssh2-1.2.4/include -L/libssh2-1.2.4/src/obj -L/openssl-0.9.8k/ -L/SecuritySDK/3.0.13/RC/LATEST/security/lib  -lssh2 -ldl -lnsl -lresolv -lhash -lhandlers -lcrypto -lssl -lz -lbpwp3   rhost.o rpipe.o rutils.o -o rpipe
  </code></pre>
  
  <p>following is the class member function</p>
  
  <pre><code>void rhost::InitSession()
  {
      m_session = libssh2_session_init();
      if ( libssh2_session_startup(m_session, m_sock) )
      {
          fprintf (stderr, "Failure establishing SSH session\n");
          exit(-1);
      }
      return;
  }
  </code></pre>
  
  <p>Yes platform is linux </p>