Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-17-2005
ralf3 ralf3 is offline
Registered User
 
Name: hexun
Organization: china
Project: spine
 
Join Date: Dec 2004
Posts: 6
Problem when use ice 2.1 and ace on vc6.0! help!

My program use ICE and ACE(Adaptive Communication Environment) in some place. when I built it in vc6.0,i get the errors below:

C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2487: 'ace_os_main_i' : member of dll interface class may not be declared with dll interface
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2838: illegal qualified name in member declaration
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2059: syntax error : 'return'
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2238: unexpected token(s) preceding ';'
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2628: 'Application' followed by 'int' is illegal (did you forget a ';'?)
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2065: 'ACE_Main' : undeclared identifier
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2146: syntax error : missing ';' before identifier 'm'
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2065: 'm' : undeclared identifier
C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2065: 'ace_os_main_i' : undeclared identifier
C:\Ice-2.1.0-VC60\include\Ice/Application.h(34) : error C2575: 'run' : only member functions and bases can be virtual
C:\Ice-2.1.0-VC60\include\Ice/Application.h(34) : error C2072: 'run' : initialization of a function
C:\Ice-2.1.0-VC60\include\Ice/Application.h(90) : error C2143: syntax error : missing ';' before '}'
C:\Ice-2.1.0-VC60\include\Ice/Application.h(90) : error C2143: syntax error : missing ';' before '}'
C:\Ice-2.1.0-VC60\include\Ice/Application.h(90) : error C2143: syntax error : missing ';' before '}'
C:\Ice-2.1.0-VC60\include\Ice/Connection.h(40) : error C2143: syntax error : missing ';' before '{'
C:\Ice-2.1.0-VC60\include\Ice/Connection.h(40) : error C2447: missing function header (old-style formal list?)




what is the problem?? I think maybe ICE use stlport 4.6 and ACE use the vc6.0 stl , so they confict.

what should i do? use vc7.1??
Reply With Quote
  #2 (permalink)  
Old 03-17-2005
marc's Avatar
marc marc is online now
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
I don't understand these error messages. For example:

C:\Ice-2.1.0-VC60\include\Ice/Application.h(33) : error C2487: 'ace_os_main_i' : member of dll interface class may not be declared with dll interface

Ice/Application.h does not contain 'ace_os_main_i' at line 33.

In any case, you definitely must use the same STL implementation for both Ice and ACE. If you use Visual C++ 6.0, then you must use STLport, as the built-in STL has too many bugs. An easier solution is to use Visual C++ 7.1, which has a fully functional STL, so that STLport is not necessary.

You must also make sure that you compile both Ice and ACE with the same compiler settings. For example, in most cases you cannot mix debug and release DLLs.
Reply With Quote
  #3 (permalink)  
Old 03-17-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
the ace main problem

within the ace headers (i think it is ace.h)
the symbole main is redefined to ace_os_main_i

advise to ge around it:
change the order of includes - let ace.h be the last

this is extraced from my mind - i no longer have ace sources
available to check.

hope this helps,

tom

PS:
an you should really make sure there is only one stl implementation in use!
two different versions blow your code and can cause troubles.

Last edited by DeepDiver : 03-17-2005 at 10:59 AM.
Reply With Quote
  #4 (permalink)  
Old 03-17-2005
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 813
See this thread as well:
Application.h compiler error on int main(int, char*[], const char* = 0);

Cheers,
Bernard
Reply With Quote
  #5 (permalink)  
Old 03-17-2005
marc's Avatar
marc marc is online now
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
ACE has a #define for main?? I'm shocked. This is about as bad as it can get with respect to abusing the C preprocessor.
Reply With Quote
  #6 (permalink)  
Old 03-17-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
extracted from <ace/os_main.h>:

Code:
# if !defined (ACE_MAIN)
#   define ACE_MAIN main
# endif /* ! ACE_MAIN */
Reply With Quote
  #7 (permalink)  
Old 03-17-2005
marc's Avatar
marc marc is online now
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
This code wouldn't be a problem, as nobody is forced to use ACE_MAIN (it's still not "nice", but this is then more a matter of style). However, I had the impression that ACE actually #defines "main" as "ace_os_main_i".
Reply With Quote
  #8 (permalink)  
Old 03-17-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
Marc,

there is more code within this header, which finally causes the described troubles.
i just wanted to show you the piece of code.

regards,

tom
Attached Files
File Type: zip OS_main.zip (1.7 KB, 221 views)
Reply With Quote
  #9 (permalink)  
Old 03-17-2005
marc's Avatar
marc marc is online now
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Yep, there are lots of #define main in there. This explains the trouble.
Reply With Quote
  #10 (permalink)  
Old 03-17-2005
ralf3 ralf3 is offline
Registered User
 
Name: hexun
Organization: china
Project: spine
 
Join Date: Dec 2004
Posts: 6
I put ace.h at the last of my include , the trouble is solved !!!

thanks for help !!!!


Regards,

Ralf
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


All times are GMT -4. The time now is 07:14 AM.


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.