歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> SUSE 下 安裝 zhcon 2.6

SUSE 下 安裝 zhcon 2.6

日期:2017/2/28 16:35:46   编辑:Linux教程

fblinear4.cpp:75: 錯誤:‘memset’在此作用域中尚未聲明

如果SUSE 下安裝zhcon出問題,這裡是第一個報錯的地方。我也在網上搜了一下,有人說是gcc4.3開始頭文件的變更,讓我想起去看看這個版本的時 間,2006-05-04,即便是那個2.6的patch也已經過時了。但畢竟用zhcon的人已經越來越少了,所以我只要把思路給出來,也不去做 patch了。
在zhcon的make過程中,有很多次報錯,說缺少memset,memcpy等函數的定義,是缺少#include <string.h>;有幾次缺少abs,atoi,free等的定義,是缺少#include <stdlib.h>;還有報fd_set結構的定義,是缺少#include <sys/select.h>;另外,缺少幾個常量定義,我從以前版本的內核頭文件中找到,然後寫入了src/lrmi.c中(好像就是這個 文件缺),共用到如下幾個量:
#define VIF_MASK 0x00080000 /* virtual interrupt flag */
#define IF_MASK 0x00000200
#define IOPL_MASK 0x00003000
#define TF_MASK 0x00000100
如果有人 遇到同樣的問題,希望對你有幫助。

所有增加的內容,寫入到 config.h 中 :
include <memory.h>
#include <stdlib.h>
#include <sys/select.h>

#define VIF_MASK 0x00080000 /* virtual interrupt flag */
#define IF_MASK 0x00000200
#define IOPL_MASK 0x00003000
#define TF_MASK 0x00000100
另外這些以後還會有一個文件報錯。到時候添加一個 #include <stdlib.h> 即可。


環境:kernel 2.6.27
gcc-4.3.2

Copyright © Linux教程網 All Rights Reserved