#include
by
iyxing
-
C/C++
-
2008-03-25 19:03:47 阅读(1536) 回复(1)
错误指向了这一行。 extern master_info_tp* pmaster_info; 我只是声明一个外部结构体指针,这么做不行?
[code]
#include
socket 编程中,通过gethostbyname() 或者 gethostbyaddr 取得主机的 hostent 解构的信息, 现在从中提取出地址信息: [code] struct host * host; struct sockaddr_in address; .... ... ... memcpy (&address.sin_addr, host->h_addr_list[0], sizeof(address.sin_addr)); 或者: address.sin_addr=*((struct in_addr *)host->h_addr); [/code] 编译的时候出现这样的错误: error: dereferencing pointer to incomplete type ...
我定义了一个 # define ASSERT_ARGS(a) ((void)0) 然后在函数里面使用这个宏,比如: int foo(arg) { ASSERT_ARGS(arg); int i = 0; bar(i); return 1; } 但是编译会出现 iso C90 forbids mixed declarations and code 这个宏如何定义才能绕过这个错误? 不允许交换宏在代码中的位置,仅仅是改写这个宏,宏定义的代码必须能gcc 优化掉,比如((void)0). 这个好像有点难度,我一直没有找到方法。 ...
编译一个内核模块出现如下错误 error: 'for' loop initial declaration used outside C99 mode 模块中有使用C99的指定初始化技术定义一个结构体: static struct file_operations dev_fops = { .ioctl = dev_ioctl, .open = dev_open, .release = dev_release }; 在函数 dev_ioctl() 中使用 for 循环的时候出现上述错误, 请问是什么原因呢? 编译加选项 --std=c99 不能解决问...
本贴我说不好要放在哪个具体的讨论区,觉得c区还合适,就放这里了, 本贴的目的是帮比我还菜的小鸟遇到这个问题好解决些,写完这个我 想在google或者baidu上搜partitions.h:61: error: field `list' has incomplete type 这样的关键字,应该能找到这贴了吧. 我今天在编译linux2.6.14.2的内核的时候,遇到了这个问题, 但是在google和baidu上找,都是提问的,就没有理睬过,那好 我就自己找答案: 主要是针对s3c2410的内核移植, 在我都培植好后...
cstm检测出来 ext/DIMM: ext3a/3b error type :single-bit 88 address(es) with errors logged by memory logging daemon.
原来在windows下能运行的程序,移植到linux下,出现上述错误,请大侠不吝赐教! 附部分相关代码: struct listen { char Cookie; long RequestTimeStamp; long RequestFileSize; struct listen *left, *right ; }listenqueue; struct BufferQueue *h=NULL ; h=(struct BufferQueue *)malloc(sizeof ( BufferQueue)); h->Cookie=a ; h->RequestTimeStamp=finish ; h->RequestFileSize = (rand()%100) ; h->le...
ibm netfinity5500上装sco5.07时get fs type error??? 是什么原因??