如何用gcc编译.c、.h和.so文件?

如何用gcc编译.c、.h和.so文件?,gcc,Gcc,目前我正在用linux做一些嵌入式编程。所以我有一台主机Linux ubuntu和我的qemu xilinx zynq(虚拟)。 comile normal.c文件很简单(bash>arm-xilinxa9-linux-gnueabi-gcc filename.c-g-o outputfilename) outputfilename在qemu xilinx zynq中是可执行的 现在我有3种类型的文件hello.c hello.h和hello.so,我希望任何人都能告诉我如何一起编译这3个文件,

目前我正在用linux做一些嵌入式编程。所以我有一台主机Linux ubuntu和我的qemu xilinx zynq(虚拟)。 comile normal.c文件很简单(bash>arm-xilinxa9-linux-gnueabi-gcc filename.c-g-o outputfilename)

outputfilename在qemu xilinx zynq中是可执行的

现在我有3种类型的文件hello.c hello.h和hello.so,我希望任何人都能告诉我如何一起编译这3个文件,谢谢:)


hello.c hello.h hello.so

下面的示例编译了一些东西并创建了一个可执行文件。我建议看一下
Makefile
。命令行对小型项目有意义,但仅此而已

gcc -c -I ../include/something foo.c   
gcc -o prog main.o foo.o -L/usr/local/lib/boo -lboo
。所以
是一个共享库-可能不是您想要的