unix 课件new

unix 课件new

ID:34494396

大小:158.59 KB

页数:36页

时间:2019-03-06

unix 课件new_第1页
unix 课件new_第2页
unix 课件new_第3页
unix 课件new_第4页
unix 课件new_第5页
资源描述:

《unix 课件new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、四、UNIX环境下的C程序设计1.UNIX下的C编程工具(GNU)2.基本的C程序设计过程3.Howtowriteamakefile4.DebugaCprogramwithgdb5.UNIX环境下的基本C程序设计1)FileI/O2)Fileanddirectory3)Allocatedynamicmemory4)TimeandDate5)Stringhandling6)CreateCLibrary7)ProcessControl1.UNIX下的C编程工具(GNU)gccGNUprojectCan

2、dC++compilermakeGNUmakeutilitytomaintaingroupsofprogramsgdbTheGNUdebuggerautoconfautomakeAnalyzetheperformanceofCprogramlibtool———————————————————strace......getstatgprofindent>>Csourcefiles==>excutablefile==>vihello.ccathello.c#includemain()

3、{printf(“HelloSJTU!”);}==>gcchello.cgcchello.c-ohellols./helloa.outhello.cHelloSJTU!==>./a.outHelloSJTU!>>gccgcc-g-omy_proghello.cgcc[options]infile...-c——Createlinkableobjectfileforeachsourcefile,butdonotcalllinker.-ofilename——Specifyoutputfileasfi

4、le.Defaultisa.out.-xlanguage——Expectinputfiletobewritteninlanguage(c,c++,assenbl-v——Verbosemode.Displaycommandsastheyareexecuted,gccversionnumber,andpreprocessorversionnumber.-S——Compilesourcefilesintoassemblercode,butdonotassembl-E——Preprocessthesour

5、cefiles,butdonotcompile.-O[level]——Optimize.levelshouldbe1,2,3,or0.Thedefaultis1.0turnsoffoptimization;3optimizes-g——Includedebugginginformationforusewithgdb.......[root@localhost~]#gcc--helpUsage:gcc[options]file...Options:-pass-exit-codesExitwithhig

6、hesterrorcodefromaphase--helpDisplaythisinformation--target-helpDisplaytargetspecificcommandlineoptions(Use'-v--help'todisplaycommandlineoptionsofsub-processes)-dumpspecsDisplayallofthebuiltinspecstrings-dumpversionDisplaytheversionofthecompiler-dumpm

7、achineDisplaythecompiler'stargetprocessorOptiontypes:==>mangccCLanguageOptionsC++LanguageOptionsWarningOptionsDebuggingOptionOptimizationOptionsPreprocessorOptionsAssemblerOptionsLinkerOptionsDirectoryOptionsTargetOptionsMachineDependentOptionsCodeGen

8、erationOptions……>>makeandmakefilemakeutility——determineautomaticallywhichpiecesofalargeprogramneedtoberecompiledandissuethecommandsmaketorecompilethemmakecleanBydefault,whenmakelooksforthemakefile,ittriesthefollowingnames,inorder:`GNUmakefile'

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。