command help for sin function

Can anyone please tell me the command line for compiling a simple program with a sin function in it ?
eg normally for programs I use .....
c++ filename.cpp -o filename
to compile.
On c I used to use....
gcc filename.c -o -lm filename.

but that will not work (I think) with C++

I am running linux mint petra with the text editor that came with that edition.
thanks
dave
http://courses.cs.washington.edu/courses/cse373/99au/unix/g++.html
http://stackoverflow.com/questions/10447791/what-does-lm-option-do-in-g

You should be able to do:
$ g++ -lm filename.cpp -o filename


Although, according to StackOverflow, you don't need to do this for C++ code.

What are the error messages?
Topic archived. No new replies allowed.