Discussion:
[omniORB] Error: expected primary-expression before "const"
Lakshmeeshk
2009-09-23 20:10:38 UTC
Permalink
Hi,



While compiling "client" program, I am getting below attached error.



client.cpp: In function `int main(int, char**)':

client.cpp:67: error: expected primary-expression before "const"

make: *** [build/client.o] Error 1



In client.cpp program: [ I have attached the lines, where I am suspecting
error within this]



name[0].id = (const char *) "Producer1";

name[0].kind = (const char *) "";



obj = ns->resolve(name);



SysTrace::Producer_var producer =
SysTrace::Producer::_narrow(obj.in());



producer->write(const char* data);



Could anyone help me on this?



Let me know if you need any additional details.



Regards,

Lakshmeesh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090923/63205940/attachment.htm
Smits, Martin
2009-09-23 21:44:43 UTC
Permalink
Hi Lakshmeeshk

You are probably correct about your code. The last line in your example is not syntactically correct C or C++. You are not allowed to specify a type in the () when calling a function.

Greetz,
Martin

From: omniorb-list-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] On Behalf Of Lakshmeeshk
Sent: woensdag 23 september 2009 16:04
To: omniorb-***@omniorb-support.com
Subject: [omniORB] Error: expected primary-expression before "const"

Hi,

While compiling "client" program, I am getting below attached error.

client.cpp: In function `int main(int, char**)':
client.cpp:67: error: expected primary-expression before "const"
make: *** [build/client.o] Error 1

In client.cpp program: [ I have attached the lines, where I am suspecting error within this]

name[0].id = (const char *) "Producer1";
name[0].kind = (const char *) "";

obj = ns->resolve(name);

SysTrace::Producer_var producer = SysTrace::Producer::_narrow(obj.in());

producer->write(const char* data);

Could anyone help me on this?

Let me know if you need any additional details.

Regards,
Lakshmeesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090923/d06abdcf/attachment.htm
Loading...