编译问题 [英] problem with compilation

查看:53
本文介绍了编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是C编程新手。编译样本时遇到问题,


#include< stdio.h>


int getuniqueaddress1(){

返回1;

}

int getuniqueaddress2(){

返回2;

}


int getuniqueaddress3(){

返回3;

}


typedef struct IRpcStubBufferVtbl

{

int wuEpad10; int wuEpad20; int wuEpad30;


} IRpcStubBufferVtbl;

struct IRpcStubBuffer

{

struct IRpcStubBufferVtbl * lpVtbl;

};


typedef struct tagCInterfaceStubVtbl

{

IRpcStubBufferVtbl Vtbl;

} CInterfaceStubVtbl;


const CInterfaceStubVtbl _IClassFactoryStubVtbl =

{

getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3( )


};


int main()

{


}

任何关于我为什么遇到编译错误的想法?任何解决方法

修复这个问题?


提前致谢,

Seema

Hi all,
I am new to C programming. I have problem compiling a sample ,

#include <stdio.h>

int getuniqueaddress1(){
return 1;
}
int getuniqueaddress2(){
return 2;
}

int getuniqueaddress3(){
return 3;
}

typedef struct IRpcStubBufferVtbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

}IRpcStubBufferVtbl;
struct IRpcStubBuffer
{
struct IRpcStubBufferVtbl *lpVtbl;
};

typedef struct tagCInterfaceStubVtbl
{
IRpcStubBufferVtbl Vtbl;
} CInterfaceStubVtbl;

const CInterfaceStubVtbl _IClassFactoryStubVtbl =
{
getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()

};

int main()
{

}
Any idea about why I am hitting compilation error? Any work around for
fixing this problem?

Thanks in advance,
Seema

推荐答案

seema写道:
大家好,
我是C编程的新手。编译样本时遇到问题,

#include< stdio.h>

int getuniqueaddress1(){
返回1;
}
int getuniqueaddress2(){
返回2;
}
int getuniqueaddress3(){
返回3;
}

typedef struct IRpcStubBufferVtbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

} IRpcStubBufferVtbl;
struct IRpcStubBuffer
结构IRpcStubBufferVtbl * lpVtbl;
};

typedef struct tagCInterfaceStubVtbl
{
IRpcStubBufferVtbl Vtbl;
} CInterfaceStubVtbl;

const CInterfaceStubVtbl _IClassFactoryStubVtbl =
以下划线后跟大写字母开头的标识符

保留给实现。 {
getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()
静态(在本例中为文件范围)变量必须用

*常量*初始化(如果它们''在C.中移动

声明到main()并根据需要传递。
};

int main()
{

}
我想知道为什么会出现编译错误?是否有任何解决方法来解决这个问题?
Hi all,
I am new to C programming. I have problem compiling a sample ,

#include <stdio.h>

int getuniqueaddress1(){
return 1;
}
int getuniqueaddress2(){
return 2;
}

int getuniqueaddress3(){
return 3;
}

typedef struct IRpcStubBufferVtbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

}IRpcStubBufferVtbl;
struct IRpcStubBuffer
{
struct IRpcStubBufferVtbl *lpVtbl;
};

typedef struct tagCInterfaceStubVtbl
{
IRpcStubBufferVtbl Vtbl;
} CInterfaceStubVtbl;

const CInterfaceStubVtbl _IClassFactoryStubVtbl = Identifiers beginning with an underscore followed by a capital letter
are reserved to the implementation. {
getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3() Static (in this case file scope) variables must be initialized with
*constants* (if they''re explicitly initialized) in C. Move the
declaration into main() and pass as needed.
};

int main()
{

}
Any idea about why I am hitting compilation error? Any work around for
fixing this problem?



见上文。


但是,下次确保包括编译你得到的错误。


HTH,

- g

-

Artie Gold - - 德克萨斯州奥斯汀
http://goldsays.blogspot.com
你不能亲吻*除非你错过**

[* - 保持简单,愚蠢。 ** - 简单,愚蠢。]


See above.

Next time, however, be sure to include the compilation errors you get.

HTH,
--ag
--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com
"You can''t KISS* unless you MISS**"
[*-Keep it simple, stupid. **-Make it simple, stupid.]




这是我在编译这个程序时得到的编译错误

HP-UX,

" xsample2.c",第31行:错误#2059:

常量不允许函数调用

表达

getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()

^


" xsample2。 c",第31行:错误#2146:初始化程序值太多

getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()

^

在xsample2.c编译中检测到2个错误

Artie Gold写道:

Here is the compilation error i get when I compile this program on
HP-UX,
"xsample2.c", line 31: error #2059: function call is not allowed in a
constant
expression
getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()
^

"xsample2.c", line 31: error #2146: too many initializer values
getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()
^

2 errors detected in the compilation of "xsample2.c"
Artie Gold wrote:
seema写道:
大家好,
我是C编程新手。编译样本时遇到问题,

#include< stdio.h>

int getuniqueaddress1(){
返回1;
}
int getuniqueaddress2(){
返回2;
}
int getuniqueaddress3(){
返回3;
}

typedef struct IRpcStubBufferVtbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

} IRpcStubBufferVtbl;
struct IRpcStubBuffer
结构IRpcStubBufferVtbl * lpVtbl;
};

typedef struct tagCInterfaceStubVtbl
{
IRpcStubBufferVtbl Vtbl;
} CInterfaceStubVtbl;

const CInterfaceStubVtbl _IClassFactoryStubVtbl =
Hi all,
I am new to C programming. I have problem compiling a sample ,

#include <stdio.h>

int getuniqueaddress1(){
return 1;
}
int getuniqueaddress2(){
return 2;
}

int getuniqueaddress3(){
return 3;
}

typedef struct IRpcStubBufferVtbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

}IRpcStubBufferVtbl;
struct IRpcStubBuffer
{
struct IRpcStubBufferVtbl *lpVtbl;
};

typedef struct tagCInterfaceStubVtbl
{
IRpcStubBufferVtbl Vtbl;
} CInterfaceStubVtbl;

const CInterfaceStubVtbl _IClassFactoryStubVtbl =


以下划线后跟大写字母开头的标识符
保留给实现。


Identifiers beginning with an underscore followed by a capital letter
are reserved to the implementation.

{
getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()
{
getuniqueaddress1(),getuniqueaddress2(),getuniquea ddress3()


静态(在本例中为文件范围) )变量必须在C中用
*常量*(如果它们被显式初始化)初始化。将
声明移动到main()并根据需要传递。


Static (in this case file scope) variables must be initialized with
*constants* (if they''re explicitly initialized) in C. Move the
declaration into main() and pass as needed.


};

int main()


我知道为什么会遇到编译错误?是否有解决这个问题的工作?

};

int main()
{

}
Any idea about why I am hitting compilation error? Any work around for
fixing this problem?


见上文。

然而,下次确保包含你得到的编译错误。

HTH,
- $

-
Artie Gold - 德克萨斯州奥斯汀
http://goldsays.blogspot.com
你不能亲吻*除非你错过了
[* - 保持简单,愚蠢。 ** - 简单,愚蠢。]


See above.

Next time, however, be sure to include the compilation errors you get.

HTH,
--ag
--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com
"You can''t KISS* unless you MISS**"
[*-Keep it simple, stupid. **-Make it simple, stupid.]






2006年3月15日星期三05:38,seema opined(

< 11 ********************* @ p10g2000cwp.googlegroups.com>):
On Wednesday 15 March 2006 05:38, seema opined (in
<11*********************@p10g2000cwp.googlegroups. com>):
seema写道:
>大家好,
>我是C编程的新手。编译样本时遇到问题,


< snip问题代码,提供的解决方案>

>任何关于我为什么遇到编译错误的想法?任何工作
>解决这个问题?
>
> Hi all,
> I am new to C programming. I have problem compiling a sample ,
<snip problem code, and solution provided>
> Any idea about why I am hitting compilation error? Any work around
> for fixing this problem?
>


见上文。

下次,请确保包含您获得的编译错误。


See above.

Next time, however, be sure to include the compilation errors you
get.


以下是我编译此程序时遇到的编译错误


Here is the compilation error i get when I compile this program on



< snip错误消息>


首先,请不要发帖(我这次更正了)。


其次,发布编译错误没有任何理由或价值,特别是当Artie

正确猜到你的问题是什么时,并给出了如何修复它的建议。


-

BR,Vladimir


CYNIC:

透过玫瑰色眼镜看上去有黄疸眼镜的人。



<snip error messages>

First, please don''t top-post (I corrected it this time).

Second, there was no reason, or value, in posting compilation errors
after you were given explanation of the problem, especially as Artie
correctly guessed what your problem was, and gave advice how to fix it.

--
BR, Vladimir

CYNIC:
One who looks through rose-colored glasses with a jaundiced eye.


这篇关于编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆