在函数main中:对exec的未定义引用 [英] In function main: undefined reference to exec

查看:354
本文介绍了在函数main中:对exec的未定义引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了此页面, 我做了这个文件

I came across this page, and I made this file

#include <unistd.h> 
int main(void) {
  exec("ls");
  return 0;
}

但是编译它会给我这个信息

However compiling it gives me this message

$ cc foo.c
undefined reference to `exec'

该页面只是伪造的吗?过时了吗这是怎么回事?

Is that page just bogus? Out of date? What is going on here?

推荐答案

该页面不是伪造的.但是,提供的链接所引用的代码实际上是Java,因为该站点是指ImageJ程序,即图像处理和分析"应用程序.请参见此处.

The page is not bogus. However, the code referenced per the link provided is actually Java, as the site refers to the ImageJ program, an "Image Processing and Analysis" Application. See here.

这篇关于在函数main中:对exec的未定义引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆