where is the lib of "cexp" about GCC?

Z

zhangmo2000

I had wrote a program and gcc -c XXX.c, the error is undefined
reference to 'cexp' , I want to link the lib about 'cexp', but I don't
know where it is.
 
S

santosh

I had wrote a program and gcc -c XXX.c, the error is undefined
reference to 'cexp' , I want to link the lib about 'cexp', but I don't
know where it is.

This is an FAQ - <http://www.c-faq.com/>

Basically you need to include an '-lm' switch with your compilation
command:

gcc -c xxx.c -lm

This tells the linker to link against the system's math libraries which
are separate from the Standard C library on UNIX systems.
 
I

Ian Collins

I had wrote a program and gcc -c XXX.c, the error is undefined
reference to 'cexp' , I want to link the lib about 'cexp', but I don't
know where it is.
Add -lm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top