在Ubuntu使用gcc编译的程序无法运行的问题。

在Ubuntu(中文(简)版)使用gcc编译的程序无法运行。

程序

#include <stdio.h>

int main()

{

  printf(“Hello!”);

  return 0;

}

在终端cd 到程序所在的目录下。我的程序在桌面-》c文件夹下,使用

cd 桌面/c

gcc hello.c –o hello

调用

./hello

出现 /桌面/c$,没有显示hello!后来觉得有可能是中文文件夹得缘故,放到了一个新建英文文件夹中后编译-运行都能出现预定的结果。

原文地址:https://www.cnblogs.com/lecone/p/1966976.html