gpt4 book ai didi

linux - 我在使用mpicc进行编译时遇到技术问题

转载 作者:行者123 更新时间:2023-12-02 11:09:55 25 4
gpt4 key购买 nike

当我编译'''gcc'''时,我的gcc正常工作,但是我尝试使用'''mpicc'''编译C程序,并且我的终端返回此错误,该错误还会删除脚本:

/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status


编译指令为: mpicc -o p35.c

我该如何解决?

我的gcc版本:
gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


我的mpicc版本:
mpicc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

谢谢。

最佳答案

编译命令错误

mpicc p35.c -o p35.out

现在运行p35.out文件

./p35.out

我想你明白了。

关于linux - 我在使用mpicc进行编译时遇到技术问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61953263/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com