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.

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.