ythtBBS安裝編譯問題

出錯程序:
int
frame_input(int pid)
{
 printf("<script language=/"JavaScript/">
 function r1() {
出錯信息:
bbsnewchat.c:88:16: missing terminating " character
解決方法:
編譯安裝ythtBBS時,常遇到這樣的錯誤提示。因爲編譯器對字符串的處理方式不

同,所以會出現以上的錯誤。解決的方法,是在出錯行的字符串結尾加上“(分號

)。
因爲
一般語句裏面換行寫沒問題 比如
printf("12345"
   "67890/n"); //輸出1234567890,注意這裏5後面的"和6前面的"號,上面出錯

程序就是犯了這樣的錯誤。
又比如
printf("123"
   "456"
   "789"
   "/n");
#define的話要寫在一行裏面,或者用/,比如
#define ABC "12345" /
   "67890"
bbsnewchat.c:294:36: warning: character constant too long for its type
bbsnewchat.c:294: error: stray '/300' in program
bbsnewchat.c:294: error: stray '/353' in program
bbsnewchat.c:294: error: stray '/277' in program
bbsnewchat.c:294: error: stray '/252' in program
bbsnewchat.c:294: error: stray '/262' in program
bbsnewchat.c:294: error: stray '/350' in program
bbsnewchat.c:294: error: stray '/271' in program
bbsnewchat.c:294: error: stray '/335' in program
bbsnewchat.c:295:19: warning: character constant too long for its type
bbsnewchat.c:295: error: stray '/301' in program
bbsnewchat.c:295: error: stray '/304' in program
bbsnewchat.c:295: error: stray '/314' in program
bbsnewchat.c:295: error: stray '/354' in program
bbsnewchat.c:295: error: stray '/312' in program
bbsnewchat.c:295: error: stray '/322' in program
bbsnewchat.c:295: error: stray '/260' in program
bbsnewchat.c:295: error: stray '/357' in program
bbsnewchat.c:295: error: stray '/326' in program
bbsnewchat.c:295: error: stray '/372' in program
出錯信息裏的/***(比如/372)是漢字,出錯的原因是因爲gcc版本的處理方式,

301是漢字,有的編譯器字符串可以跨多行,有的編譯器不行。上面的出錯就是因

爲編譯器的版本問題。解決的方法是,在每行的後面加上一個 /(表示換行) 就可

以了。                                                       

待續

發佈了47 篇原創文章 · 獲贊 1 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章