title: Get the following errors when I compile with G++
body: <p>I am a bit new to programming as you can probably tell from my prior question(s). I was wondering if anyone could help me with this recent problem I've had. I am trying to compile a script main.cpp using g++ but I get the following errors:</p>
  
  <pre><code>Donny@Donny-PC /cygdrive/c/Users/Donny/Desktop/equation/equations/equations
  $ g++ main.cpp -o don.exe
  main.cpp:3:11: error: ‘::main’ must return ‘int’
   void main(){
         ^
  main.cpp: In function ‘int main()’:
  main.cpp:36:22: error: ‘pow’ was not declared in this scope
    float n=pow(10.0,9.0);
                    ^
  main.cpp:43:27: error: ‘sin’ was not declared in this scope
    float R56=(lb1/sin(theta1)) * ((tan(theta1))-theta1) + (lb2/sin(theta1)) *                ((tan(theta1))-theta1) +
                         ^
  main.cpp:43:44: error: ‘tan’ was not declared in this scope
    float R56=(lb1/sin(theta1)) * ((tan(theta1))-theta1) + (lb2/sin(theta1)) *     ((tan(theta1))-theta1) +
                                          ^
  main.cpp:48:40: error: ‘cos’ was not declared in this scope
    d*((pow(tan(theta1),2))/cos(theta1)) +
                                      ^
  </code></pre>
  
  <p>The weird thing is that this code works when compiled with microsoft visual studio 2010 C++. Any help would be greatly appreciated!</p>
  
  <p>EDIT:</p>
  
  <p>So, the  fixed a lot of the errors shown above, but I am still having a little difficulty fixing the void main error. Here is how my code looks:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  using namespace std;
  void main(){
      float r, i, f, beta, alpha;
      cout&lt;&lt;"Enter value of R : ";............
  </code></pre>
  
  <p>Any help or examples would be greatly appreciated.</p>