Linux (ubuntu) undefinedreferenceto 'sin' Solution

Source: Internet
Author: User
Linux (ubuntu) undefinedreferenceto 'sin Problem Solving-Linux general technology-Linux programming and kernel information, the following is a detailed description. This problem occurs during program compilation today:

Whetstone. c :(. text + 0x56c): undefined reference to 'sin'
Whetstone. c :(. text + 0x585): undefined reference to 'cos'
Whetstone. c :(. text + 0x5cf): undefined reference to 'ata'

Check that the header file math. h already contains math. h. Although the program already contains math. h, you must link it to the math library and add the-lm compilation option as follows:

Change gcc whetstone. c-o whetstone to gcc whetstone. c-lm-o whetstone.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.