work hard work smart

专注于Java后端开发。 不断总结,举一反三。
随笔 - 1158, 文章 - 0, 评论 - 153, 阅读 - 186万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 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 28 29
30 31 1 2 3 4 5

搭建程序框架

Posted on   work hard work smart  阅读(74)  评论(0编辑  收藏  举报

在/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

 

相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
历史上的今天:
2020-04-05 Rabbit MQ总结
2020-04-05 AtomicInteger及CAS源码解析
2020-04-05 Queue(队列)接口和其实现类PriorityQueue(优先级队列)源码解析
点击右上角即可分享
微信分享提示