Archived

This forum has been archived. Please start a new discussion on GitHub.

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??

Comments

  • marc
    marc Florida
    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.
  • 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.
  • bernard
    bernard Jupiter, FL
    See this thread as well:
    http://www.zeroc.com/vbulletin/showthread.php?s=&threadid=605

    Cheers,
    Bernard
  • marc
    marc Florida
    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.
  • extracted from <ace/os_main.h>:
    # if !defined (ACE_MAIN)
    #   define ACE_MAIN main
    # endif /* ! ACE_MAIN */
    
  • marc
    marc Florida
    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".
  • 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
  • marc
    marc Florida
    Yep, there are lots of #define main in there. This explains the trouble.
  • I put ace.h at the last of my include , the trouble is solved !!!

    thanks for help !!!!


    Regards,

    Ralf