我试图在'开箱即用'的操作系统上运行BeagleBone Black上的一些程序,但是在使用gcc编译时我一直遇到问题.在尝试编译简单的hello world程序时,最好地说明了这一点:
#include <stdio.h>
int main(void)
{
printf("Hello World\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
编译和运行它的输出是:
debian@beaglebone:~$ g++ helloworld.c -o test
debian@beaglebone:~$ ./test
Hello World
debian@beaglebone:~$ gcc helloworld.c -o test
debian@beaglebone:~$ ./test
./test: line 27: typedef: command not found
./test: line 36: typedef: command not found
./test: line 37: typedef: command not found
./test: line 38: typedef: command not found
./test: line 39: typedef: command not found
./test: line 42: typedef: command not found
./test: line 43: typedef: command not found
./test: …Run Code Online (Sandbox Code Playgroud)