compiling with g++

Hi,
I try to compile program on page :
http://commons.wikimedia.org/wiki/File:Herman-ring-1.png

I have saved the code as h.cpp and use :
g++ -Wall -llibcomplex h.cpp

and get error :
h.cpp:22: error: no matching function for call to ‘polar(int, double)’

How should I do it ?

Regards

Adam

check the signature of your polar function and the parameters you are passing to the polar function. They doesn't match and there is no suitable overloaded function to call.
Thx. I thought that it was an linking error.
I have changed one line to :
const complex<double> rot=polar(1.0, 2.0*M_PI*t);//e^{2 \pi i t}
Compile with simple :
g++ h.cpp -Wall
and run
./a.out >h.pgm
It works.

Thx
Last edited on
It will tell you if its a linking error by something starting with link...
Also, you can use the -o parameter to change the name of the output file
 
g++ h.cpp -Wall -o name_of_executable_file_you_want
Topic archived. No new replies allowed.