首页 > 用户发贴区 > 编程问题提问区 > 请问这段程序为什么总是报错?急急急急
2009
09-24

请问这段程序为什么总是报错?急急急急

 

下面是在官方网站下的源码程序,没有错误,想把它打包成exe文件,可是用TC2.0和3.0都尝试过,运行总是报错:

一个错误提示为:unable to open include file’l12_proto.h’,

本人上网查了很多资料,发现大多数解决的关键在于路径的设置,因此我仔细的把路径也修改了,但是TC好像不太稳定,如果把这个错误解决,结果又出现一个错误:

linker error:unable open inputer file”cos.obj…

 

这个问题我也查过,好像大多数也是路径设置引起的,我都检查过了,没发现路径设置错误,不过,发现一个现象,就是把TC安装在不同目录的时候,出现错误的概率不一样,本人初学,还请各位高手指点,急急急急啊~

 

#include <l12_proto.h>
int atmocor2(l2str *l2rec, aestr *aerec, int32_t ip)
{
    static int firstCall   = 1;
    static int want_nirRrs = 0;
    static int want_nirLw  = 0;
    static int want_mumm   = 0;
    static int want_ramp   = 1;
    static int32_t aer_iter_max = 1;
    static int32_t aer_iter_min = 1;

    static float pi        = PI;
    static float radeg     = RADEG;
    static float badval    = BAD_FLT;
    static float badchl    = BAD_FLT;
    static float p0        = STDPR;
    static float df        = 0.33;
    static float cbot      = 0.7;
    static float ctop      = 1.3;
    static float seed_chl  = 0.0;
    static float seed_green= 0.0;
    static float seed_red  = 0.0;
    static float nir_chg   = 0.02;
    static float glint_min = GLINT_MIN;
    static float cslp;
    static float cint;


    static int32_t  green;
    static int32_t  red;
    static int32_t  nir_s;
    static int32_t  nir_l;
    static int32_t  swir_s;
    static int32_t  swir_l;
    static int32_t  aer_s;
    static int32_t  aer_l;
    static int32_t  daer;
    static int32_t  nwvis;
    static int32_t  nwave;
    static float wave[NBANDS];


    int32_t sensorID = l2rec->sensorID;
    int32_t brdf_opt = l2rec->input->brdf_opt;
    int32_t aer_opt  = l2rec->input->aer_opt;
    int32_t glint_opt= l2rec->input->glint_opt;


    int32_t  *bindx  = l2rec->bindx;
    float *Fo     = l2rec->Fo;
    float *Fobar  = l2rec->Fobar;


    float fsol   = l2rec->fsol;
    float solz   = l2rec->solz  [ip];
    float senz   = l2rec->senz  [ip];
    float delphi = l2rec->delphi[ip];
    float ws     = l2rec->ws    [ip];
    float wv     = l2rec->wv    [ip];
    float gc     = l2rec->glint_coef[ip];


    int32_t  *aermodmin = &l2rec->aermodmin[ip];
    int32_t  *aermodmax = &l2rec->aermodmax[ip];
    float *aermodrat = &l2rec->aerratio [ip];
    float *eps       = &l2rec->eps      [ip];


    float *TLg   = &l2rec->TLg  [ip*NBANDS];
    float *Lw    = &l2rec->Lw   [ip*NBANDS];
    float *nLw   = &l2rec->nLw  [ip*NBANDS];
    float *La    = &l2rec->La   [ip*NBANDS];
    float *taua  = &l2rec->taua [ip*NBANDS];
    float *t_sol = &l2rec->t_sol[ip*NBANDS];
    float *t_sen = &l2rec->t_sen[ip*NBANDS];
    float *brdf  = &l2rec->brdf [ip*NBANDS];
    float *Rrs   = &l2rec->Rrs  [ip*NBANDS];


    float *tg_sol = &l2rec->tg_sol[ip*NBANDS];
    float *tg_sen = &l2rec->tg_sen[ip*NBANDS];


    float taur [NBANDS];
    float tLw  [NBANDS];
    float rhown_nir[NBANDS];
    float tLw_nir[NBANDS], last_tLw_nir[NBANDS];
    int32_t  ib, ipb;
    int32_t  status;
    int32_t  iter, iter_max, iter_min, last_iter, iter_reset;
    float mu, mu0;
    int32_t  nneg;
    float airmass;
    float Ltemp [NBANDS];
    float chl, last_chl;
    int   want_glintcorr;
    float rhown_nir_avg, last_rhown_nir_avg;
    float pfact;


   }……


请问这段程序为什么总是报错?急急急急》有 1 条评论

  1. xstar 说:
    针对第一个问题是检查你的文件,看是否缺少l12_proto.h,另外文件路径是否正确,就是是否在系统头文件路径下还是在程序目录下。
    针对第二点,下面的设置看看,另外TC一般安装在英文目录下,并且目录字符个数小于8个。
    将tc界面环境中“options”菜单中的“directiores”命令下的第一,二,四条的路径改为tc文件夹中include文件夹、lib文件夹及tc文件夹所放置的路径中,比如:tc文件夹是放置在d:\tc\的,所以我们可以把tc界面环境中“options”菜单中的“directiores”命令下的第一条命令的路径改为d:\tc\include;第二条命令的路径改为d:\tc\lib;第四条命令的路径改为d:\tc,再运行程序就不会出现这个错误了。

留下一个回复