473,851 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with compilation

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

#include <stdio.h>

int getuniqueaddres s1(){
return 1;
}
int getuniqueaddres s2(){
return 2;
}

int getuniqueaddres s3(){
return 3;
}

typedef struct IRpcStubBufferV tbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

}IRpcStubBuffer Vtbl;
struct IRpcStubBuffer
{
struct IRpcStubBufferV tbl *lpVtbl;
};

typedef struct tagCInterfaceSt ubVtbl
{
IRpcStubBufferV tbl Vtbl;
} CInterfaceStubV tbl;

const CInterfaceStubV tbl _IClassFactoryS tubVtbl =
{
getuniqueaddres s1(),getuniquea ddress2(),getun iqueaddress3()

};

int main()
{

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

Thanks in advance,
Seema

Mar 15 '06 #1
3 3421
seema wrote:
Hi all,
I am new to C programming. I have problem compiling a sample ,

#include <stdio.h>

int getuniqueaddres s1(){
return 1;
}
int getuniqueaddres s2(){
return 2;
}

int getuniqueaddres s3(){
return 3;
}

typedef struct IRpcStubBufferV tbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

}IRpcStubBuffer Vtbl;
struct IRpcStubBuffer
{
struct IRpcStubBufferV tbl *lpVtbl;
};

typedef struct tagCInterfaceSt ubVtbl
{
IRpcStubBufferV tbl Vtbl;
} CInterfaceStubV tbl;

const CInterfaceStubV tbl _IClassFactoryS tubVtbl = Identifiers beginning with an underscore followed by a capital letter
are reserved to the implementation. {
getuniqueaddres s1(),getuniquea ddress2(),getun iqueaddress3() 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?

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.]
Mar 15 '06 #2

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
getuniqueaddres s1(),getuniquea ddress2(),getun iqueaddress3()
^

"xsample2.c ", line 31: error #2146: too many initializer values
getuniqueaddres s1(),getuniquea ddress2(),getun iqueaddress3()
^

2 errors detected in the compilation of "xsample2.c "
Artie Gold wrote:
seema wrote:
Hi all,
I am new to C programming. I have problem compiling a sample ,

#include <stdio.h>

int getuniqueaddres s1(){
return 1;
}
int getuniqueaddres s2(){
return 2;
}

int getuniqueaddres s3(){
return 3;
}

typedef struct IRpcStubBufferV tbl
{
int wuEpad10; int wuEpad20; int wuEpad30;

}IRpcStubBuffer Vtbl;
struct IRpcStubBuffer
{
struct IRpcStubBufferV tbl *lpVtbl;
};

typedef struct tagCInterfaceSt ubVtbl
{
IRpcStubBufferV tbl Vtbl;
} CInterfaceStubV tbl;

const CInterfaceStubV tbl _IClassFactoryS tubVtbl =

Identifiers beginning with an underscore followed by a capital letter
are reserved to the implementation.
{
getuniqueaddres s1(),getuniquea ddress2(),getun iqueaddress3()

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?

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.]


Mar 15 '06 #3
On Wednesday 15 March 2006 05:38, seema opined (in
<11************ *********@p10g2 000cwp.googlegr oups.com>):
seema wrote:
> 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 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.

Mar 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
416
by: Alex Vinokur | last post by:
Hi, The code below has no problem with GNU g++ 3.3, but it has a problem with GNU g++ 3.4. What is reason for that? --------- foo.cpp : BEGIN --------- template <typename T> struct Boo
9
3488
by: ludocluba | last post by:
Hello, here is my problem: I have 3 files: main.c toto.c toto.h: ----------------------------------------------------------- toto.h: #ifndef _toto_h #define _toto_h int var; void test(void); #endif -----------------------------------------------------------
3
3357
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition from 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\1f575646\ad3a161b\assembly\dl2\57ca505e\044565c0_f84fc401\Test1.DLL' The problem is that the control is defined in two different assemblies
10
6887
by: greenb | last post by:
Our asp.net web app uses a .NET component (DLL) in the bin directory to call several stored procedures back to back to perform updates. They don't return any data. Sometimes the total execution time can take 2-3 minutes, but even though I have set the executionTimeout in web.config to a high number of seconds (2400), the request will still time out after 90 seconds. The user sees a Request timed out error. The app logs a ThreadAborted...
6
2814
by: BookerW | last post by:
Ok interesting, on my local machine And i did not do a good job of keeping track of the exact order.... but on my local machine in which i have vis studio 2003 installed and IIS for win XP, I copied the web.config file from the source code folder into the inetpub\wwwroot folder b/c that is where the ASP engine was looking for it.
0
1803
by: Rasika WIJAYARATNE | last post by:
Hello everyone, We have a forum system on our website. The main web application is running in a virutal directory called /t7 and the forum system is on / t7/forums/. When someone wants to post any messages to the forum it re- directs them to a login and signup page which is kept in a different directory i.e. /t7/users/. But somewhere along the line, I believe after the users has been re-directed to the login and sign-up page (/...
12
15683
by: jcor | last post by:
Hi, I'm using Ubuntu 7.04. I'm writing a sript that sends files via ftp for several destinations. So far I used Net::FTP and it worked fine. My problem is that I need to send files via SFTP (SSH2). I've been trying to install Net::SFTP with 'sudo perl -MCPAN -e "install NET::SFTP' but I can't. It stops in the middle of the installation: Crypt-DH-0.06/t/ Crypt-DH-0.06/t/00-compile.t
1
2683
by: Alex Vinokur | last post by:
Hi, I have compilation problem on SUN CC compiler with template while using option -m64 (64-bit addressing model). No problem while using option -m32 (32-bit addressing model) $ CC -V CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
2
6400
by: somsub | last post by:
Hi all, Here is my samle code use strict ; use warnings ; use IO::Uncompress::Unzip ; When I compiled this three lines of code in win32 I got error like below.
0
9895
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10670
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9503
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7900
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4142
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.