找不到如何选择运行 C 程序的路径

标签 c

我使用的是 mac OS x 并使用 GCC 编译器编写了 C 程序。
但是在终端上运行程序时,我被显示“找不到这样的文件或目录”
请帮我如何选择路径?

最佳答案

使用$./yourProgramFile命令运行它,开头的./很重要。这意味着该程序驻留在当前目录中。

示例:

/path/to/your/cFile $ gcc myfile.c -o myfile
/path/to/your/cFile $ ./myfile

关于找不到如何选择运行 C 程序的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18159186/

相关文章:

c - 测量使用 Clang/LLVM 生成的函数的大小?

c - Ansi C 中的位设置和位移位

c - 套接字 C - Windows

c - "cannot convert to a pointer type"通过指针访问结构

c - 寻找最大的 gcd while 循环问题

c - 这段代码如何打印 404?

c - 为什么我收到警告 : (near initialization for ‘ptr’ ) and segmentation fault at runtime when accsessing value at pointer?

编译器不会在函数参数不匹配时发出错误/警告

c++ - 是否有帮助组织#includes 的工具?

c - 翻译内联汇编以支持 x64