命令用.a文件编译c文件 [英] command to compile c files with .a files

查看:100
本文介绍了命令用.a文件编译c文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个.c文件和一个.a目标文件。我应该使用gcc命令将它们编译为一个exe文件?如果我们使用makefile,它将如何看起来像? .a文件是一个已编译过的库。您将.c文件编译为.o文件,然后使用链接程序将.o与.a链接以生成可执行文件。


I have several .c files and one .a object file. What command with gcc should I use to compile them to one exe file? If we use a makefile, how will it look like?

解决方案

The .a file is a library, already compiled. You compile your .c file to a .o, then you use the linker to link your .o with the .a to produce an executable.

这篇关于命令用.a文件编译c文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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