Board logo

Subject: 编译cvstrac中文版需要准备的环境? [Print This Page]

Author: jjcvs    Time: 2006-4-19 09:59     Subject: 编译cvstrac中文版需要准备的环境?

我在Federa下编译cvstrac中文版,出现如下的问题:
......
gcc -g -O0 -Wall  -I. -I/home/regical/temp/tmp/cvstrac -o rss.o -c rss_.c
rss_.c: In function `common_rss_header':
rss_.c:43: parse error before `char'
rss_.c:52: `charset' undeclared (first use in this function)
rss_.c:52: (Each undeclared identifier is reported only once
rss_.c:52: for each function it appears in.)
make: *** [rss.o] 错误 1

请问是否是由于没有装一些环境引起的,谢谢!

[ Last edited by jjcvs on 2006-4-19 at 11:52 ]
Author: jjcvs    Time: 2006-4-19 12:26

解决了,但是还不知道为什么,

将rss.c开始的方法common_rss_header修改成如下的样子就可以通过了:
static void common_rss_header(char *zTitle, char *zDescription, int nBuildDate){
  int nTTL = atoi(db_config("rss_ttl", "60"));

#if CVSTRAC_I18N
  char * charsetpp = db_config("charset",nl_langinfo(CODESET));
#else
  char * charset = db_config("charset","GB2312");
#endif

  cgi_set_content_type("text/xml");

  @ <?xml version="1.0" encoding="%h(charset)"?>
  @ <rss version="2.0">
  @ <channel>
  @ <title>%h(g.zName) - %h(zTitle)</title>
  @ <link>%s(g.zBaseURL)/timeline</link>
  @ <description>%h(zDescription)</description>
  @ <language>zh-cn</language>
  @ <pubDate>%h(cgi_rfc822_datestamp( time(0) ))</pubDate>
  if( nBuildDate>0 ){
    const char* zBD = cgi_rfc822_datestamp(nBuildDate);
    @ <lastBuildDate>%h(zBD)</lastBuildDate>
    cgi_append_header(mprintf("Last-Modified: %h\r\n",zBD));
  }
  @ <generator>CVSTrac @VERSION@ 中文版</generator>
  @ <ttl>%d(nTTL)</ttl>
}




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0