Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-02-2004
aerowyn aerowyn is offline
Registered User
 
 
Join Date: Nov 2004
Posts: 15
Send a message via ICQ to aerowyn Send a message via AIM to aerowyn
-->
Some strange errors from MSVC.net

I am very interested in using Ice, but I am having some problems when I tried to put some test Ice code into one of my applications, and I cant track down the problem.. perhaps one of you could help me out a bit...

Here are the errors MSVC.net gives me when I try to compile:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2059: syntax error : ':'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2059: syntax error : ':'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{' before ':'

It goes on like that to give me about 100 errors, all on the same syntax in both cstdio and cstdlib.


Im sure it is something simple I am over looking, but I cant find it... any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 11-02-2004
aerowyn aerowyn is offline
Registered User
 
 
Join Date: Nov 2004
Posts: 15
Send a message via ICQ to aerowyn Send a message via AIM to aerowyn
-->
Oh yes,

And the code I am using is from the Hello demo, the demo compiles fine, but when I use some of the code in a seperate app it causes these errors.
Reply With Quote
  #3 (permalink)  
Old 11-02-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
From the error messages, it doesn't seem to be related to Ice, since it's an error an a header file supplied by Visual C++ .NET. Perhaps you have a typo in your code before a #include statement? This sometimes causes such problems.
Reply With Quote
  #4 (permalink)  
Old 11-02-2004
aerowyn aerowyn is offline
Registered User
 
 
Join Date: Nov 2004
Posts: 15
Send a message via ICQ to aerowyn Send a message via AIM to aerowyn
-->
What Im confused about is that the file, without the Ice code, compiles fine. The demo compiles fine. But when I put the demo code into the other app then it doesnt work. I included Ice/Ice.h and Hello.h and set the libs to Ice.lib and IceUtil.lib... Is there something I am overlooking?
Reply With Quote
  #5 (permalink)  
Old 11-02-2004
aerowyn aerowyn is offline
Registered User
 
 
Join Date: Nov 2004
Posts: 15
Send a message via ICQ to aerowyn Send a message via AIM to aerowyn
-->
Here is the Ice coe I am using:

#include <Ice/Ice.h>
#include "Hello.h"

using namespace std;

and the function:

void cg_IceTest()
{
Ice::PropertiesPtr properties = communicator->getProperties();
const char* proxyProperty = "Hello.Proxy";
string proxy = properties->getProperty(proxyProperty);
if(proxy.empty())
{
cerr << argv[0] << ": property `" << proxyProperty << "' not set" << endl;
return EXIT_FAILURE;
}

Ice::ObjectPrx base = communicator->stringToProxy(proxy);
HelloPrx twoway = HelloPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));
if(!twoway)
{
cerr << argv[0] << ": invalid proxy" << endl;
return EXIT_FAILURE;
}
HelloPrx oneway = HelloPrx::uncheckedCast(twoway->ice_oneway());
HelloPrx batchOneway = HelloPrx::uncheckedCast(twoway->ice_batchOneway());
HelloPrx datagram = HelloPrx::uncheckedCast(twoway->ice_datagram());
HelloPrx batchDatagram = HelloPrx::uncheckedCast(twoway->ice_batchDatagram());

bool secure = false;
int timeout = -1;

twoway->sayHello();

catch(const Ice::Exception& ex)
{
cerr << ex << endl;
}

return EXIT_SUCCESS;
}






If I comment out the function and the includes then I get this error:

cg_buttons.c(10) : error C2061: syntax error : identifier 'namespace'
cg_buttons.c(10) : error C2059: syntax error : ';'

And I have established that the error is from the includes, because just commenting out the function and the namespace definition gives me the same errors.

Last edited by aerowyn : 11-02-2004 at 04:00 PM.
Reply With Quote
  #6 (permalink)  
Old 11-04-2004
aerowyn aerowyn is offline
Registered User
 
 
Join Date: Nov 2004
Posts: 15
Send a message via ICQ to aerowyn Send a message via AIM to aerowyn
-->
Sorry about the bump....

But it is a bit important that I get this answered soon.
Reply With Quote
  #7 (permalink)  
Old 11-04-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
I'm sorry, but I'm afraid I have no clue what the problem could be.
Reply With Quote
  #8 (permalink)  
Old 11-05-2004
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
A way to figure out such problem is to save the precompiled version of your translation unit into a file, and then look at it ... or post it here.

Cheers,
Bernard
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange SEGV ... joel vennin Help Center 3 08-02-2006 05:10 AM
Ice 2.1 and MSVC++ 7.0 Nis Baggesen Help Center 3 03-10-2005 10:13 AM
how to use ICE in msvc? W.noon Help Center 2 11-04-2004 09:28 AM
Help! I cannot build Freeze successfully in MSVC 6.0 under windows 2003 paulling Help Center 4 02-27-2004 05:48 PM
Strange Behaviour galbe Help Center 5 10-19-2003 11:45 PM


All times are GMT -4. The time now is 05:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.