Menu

MVS 6 - C++ Ex1 trouble ?

Help
2008-04-03
2013-05-28
  • Jérôme ALLARD

    Jérôme ALLARD - 2008-04-03

    hello SMCans !

    I am curently testing SMC (5_0_2) and this seems great !!!
    So far everything is ok with Java, C , C++ on my redhat but ...
    Unfortunately I can't manage to make C++ example work with visual studio 6.
    Remaining error is:
       appclass_sm.cpp(_) error C2061: syntax error : identifier 'context'
    Line at stake is:
      AppClass& ctxt(context.getOwner());
    I spend some time but cannot see why this is ok with gcc but problematic with cl...
    As i am far from being a C++ guru, i just patched meanwhile in the .sm:
    %{
    #define ctxt(x) ctxt=x
    %}
    without understanding the real matter.
    Any help would be appreciated. Thanks in advance.

    jerome

     
    • Charles Rapp

      Charles Rapp - 2008-05-15

      Jerome,

      Here is what MSDN says about C2061:

      The compiler found identifier (context in this instance) where it was not expected. An initializer may be enclosed in parenthesis.

      I guess MVS 6 C++ does not like using a parameter within a local variable initializer. I have not seen this problem with later DevStudio versions, not that this fact helps you.

      Sorry if I could not be of greater assistance.

       

Log in to post a comment.

MongoDB Logo MongoDB