已经include 但是还是提示无法找到sin函数

yuchujian yuchujian 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
刚刚写了一行代码如下:已经include <math.h> 但是还是提示无法找到sin函数,
#include <math.h>
#include <stdio.h>
int main(void)
{
double pi = 3.1416;
printf("sin(pi/2)=%f\nln1=%f\n", sin(pi/2), log(1.0));
return 0;
}

报错如下:
[root@vmware_redhat_4_developer ~]# gcc -Wall -o lizi2 lizi2.c
/tmp/cccoULTf.o(.text+0x51): In function `main':
: undefined reference to `sin'
collect2: ld returned 1 exit status

请大仙门指点迷津。
...全文

相关推荐

# include <stdio.h>

# include <stdio.h> # include<stdlib.h> char stu_no[10][10]; int c_math[10],c_en[10],c_computer[10],point[10],average[10]; int i,j,max; char c; void input() { for(i=0;i<=9;i++) /*输入学生成绩*/ { printf("请输入学号:"); scanf("%s",&stu_no[i]); printf("\n请输入数学成绩:"); scanf("%d",&c_math[i]); printf("\n请输入英语成绩:"); scanf("%d",&c_en[i]); printf("\n请输入计算机基础成绩:"); scanf("%d",&c_computer[i]); } for(i=0;i<=10;i++) /*计算总分跟平均分*/ { point[i]=c_math[i]+c_en[i]+c_computer[i]; average[i]=point[i]/3; } } void paixu() { printf("成绩按从高到低排列为:\n"); printf("\n学号 数学 英语 计算机基础 总分 平均分\n"); for (i=0;i<=10;i++) { for(j=1;j<=10;j++) if (point[i]>point[j]) max=i; printf("%s,d,%d,%d,%d,%d,%d\n",stu_no[max],c_math[max],c_en[max],c_computer[max],point[max],average[max]); } } void main() { input(); paixu(); }

zhou456123

详解django使用include无法跳转的解决方法

主要介绍了详解django使用include无法跳转的解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

weixin_38677227

VS2005编译 提示无法打开包括头文件“stdint.h“

由于代码中使用了头文件<stdint.h> 但是VS2005缺少头文件stdint.h,所以在"VS2005安装路径/VC/include"(例:C:\softwore\VS2005\VC\include)路径下添加stdint.h文件即可。

qq_36208201

php set_include_path函数设置 include_path 配置选项

主要介绍了php set_include_path函数设置include_path 配置选项的相关资料,需要的朋友可以参考下

weixin_38670531

django使用include无法跳转的解决方法

django使用include无法跳转的解决方法 一般的django项目我都喜欢采用以下的文件结构,使用include的方式,实现从总的url分配给apps里面的url Example: -projtect ---apps -----user -------urls.py -urls.py 但突然发现无法跳转,竟然是总url的这个错误! 以下是错误做法 urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^', views.Index.as_view(), name='index'), url(r'^user

weixin_38678796
评论 18
收藏 已收藏
分享
返回顶部
yuchujian
C语言 70,040 成员 243,237 内容