title: undefined reference error for g++ but not for gcc when using BSP library
body: <p>I am making a parallel program for one of my courses. Now initially it was written in C and it all worked just fine. Then we changed it all to c++ and all of a sudden I get some error when I try to compile the program. I am using the package mcbsp (Multicore BSP) for the parallel part. Here is the program</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;mcbsp.h&gt;
  
  void sieve(){
    return ;
  }
  
  main(int argc, int **arhv){
    bsp_begin(5);
    printf("%d\n",bsp_pid());
    bsp_end();
    return 0;
  }
  </code></pre>
  
  <p>So I make a file aaa.c and aaa.cpp both with this content. Then when I type in the terminal</p>
  
  <pre><code>gcc aaa.c -MMD -g -I../bsp/include -L../bsp/lib -lmcbsp1.2.0 -lpthread
  </code></pre>
  
  <p>it compiles just fine and the program does as expected (print the id of the cores). However, when I type</p>
  
  <pre><code>g++ aaa.cpp -MMD -g -I../bsp/include -L../bsp/lib -lmcbsp1.2.0 -lpthread
  </code></pre>
  
  <p>it gives the following feedback</p>
  
  <pre><code>/tmp/ccH3uox9.o: In function `main':
  /home/teun/Documents/C/BSP/Sieve/sieve/aaa.cpp:10: undefined reference to `bsp_begin(unsigned int)'
  /home/teun/Documents/C/BSP/Sieve/sieve/aaa.cpp:11: undefined reference to `bsp_pid()'
  /home/teun/Documents/C/BSP/Sieve/sieve/aaa.cpp:12: undefined reference to `bsp_end()'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I have been stuck with this for about an hour now and it is really getting frustrating. I must admit that I have little experience in programming in c++ as I mostly use C. Does anyone know what is going wrong?</p>
  
  <p>EDIT: The program I displayed is just a small working example that uses the BSP functionality. </p>