title: C++ Linux Google Protocol Buffers - cannot run compiled proto cpp files from tutorial
body: <p>I'm following the <a href="https://developers.google.com/protocol-buffers/docs/cpptutorial" rel="nofollow noreferrer">cpp tutorial on google protocol buffers</a></p>
  
  <p>I installed Google Protocol Buffers on Ubuntu and compiled the .proto file so I got the pb.h and pb.cc generated files. </p>
  
  <p><a href="https://i.stack.imgur.com/MXCjP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MXCjP.png" alt="enter image description here"></a></p>
  
  <p>I made ReadAddressBook.cpp very minimal. It just creates the proto object and verifies if the version matches.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include "address_book.pb.h"
  using namespace std;
  
  int main(){
  
   GOOGLE_PROTOBUF_VERIFY_VERSION;
  
   tutorial::AddressBook address_book;
  
  return 0;
  }
  </code></pre>
  
  <p>I compiled it with </p>
  
  <pre><code>g++ -c ReadAddressBook.cpp
  </code></pre>
  
  <p>(also with g++ -c ReadAddressBook.cpp -lprotobuf -lpthread but it gave the same results)</p>
  
  <p>However when running:</p>
  
  <pre><code>g++ -o ReadAddressBook ReadAddressBook.o
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/D4nix.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D4nix.png" alt="enter image description here"></a></p>
  
  <p>It gave me the references to the google protobuf src was unavailable. Why would this be?</p>