在/home/study/weatherdata/project/idc2下创建如下文件夹
在c文件夹下,创建crtsurfdata1.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include "_public.h" CLogFile logfile( 10 ); int main( int argc, char *argv[]){ // printf("argc %s \n",argc); // inifile outpath logfile if ( argc != 4 ){ printf( "Using: ./crtsurfdata1 inifile outpath logfile\n" ); return - 1 ; } if (logfile.Open(argv[ 3 ]) == false ){ printf( "logfile.Open(%s) failed.\n" , argv[ 3 ]); return - 1 ; } logfile.Write( "crtsurfdata1 开始运行。\n " ); for ( int ii = 0 ;ii< 10000000 ;ii++) logfile.Write( "这是第%010d条日志记录。\n" ,ii); logfile.Write( "crtsurfdata1 结束运行。\n " ); return 0 ; } |
在c文件夹下创建makefile
1 2 3 4 5 6 7 8 9 10 11 12 13 | PUBINCL = -I/home/study/weatherdata/project/ public PUBCPP = /home/study/weatherdata/project/ public /_public.cpp CFLAGS = -g all:crtsurfdata1 crtsurfdata1:crtsurfdata1.cpp g++ $(CFLAGS) -o crtsurfdata1 crtsurfdata1.cpp $(PUBINCL) $(PUBCPP) -lm -lc cp crtsurfdata1 ../bin/. clean: rm crtsurfdata1 |
使用make命令
执行
/home/study/weatherdata/project/idc2/bin/crtsurfdata1 /home/study/weatherdata/project/idc2/ini/stcode.ini /tmp/surfdata /home/study/weatherdata/project/idc2/crtsurfdata1.log
作者:Work Hard Work Smart
出处:http://www.cnblogs.com/linlf03/
欢迎任何形式的转载,未经作者同意,请保留此段声明!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
2020-04-05 Rabbit MQ总结
2020-04-05 AtomicInteger及CAS源码解析
2020-04-05 Queue(队列)接口和其实现类PriorityQueue(优先级队列)源码解析