Home Bug Reports

Problem with AMI on GCC 4.7

mefostermefoster Member Mary Ellen FosterOrganization: Heriot-Watt University, EdinburghProject: ECHOES learning environment ✭✭✭
Hello all,

Here's a small test .ice file:
module test {
    interface TestInterface {
        ["ami"] void doTest ();
    };
};

If I run slice2cpp on this and then gcc -I. Test.cpp, I get the following errors:
In file included from ./Test.h:29:0,
from Test.cpp:21:
/usr/include/Ice/Proxy.h: In instantiation of ‘IceInternal::OnewayCallbackNC<T>::OnewayCallbackNC(const TPtr&, IceInternal::OnewayCallbackNC<T>::Response, IceInternal::OnewayCallbackNC<T>::Exception, IceInternal::OnewayCallbackNC<T>::Sent) [with T = test::AMI_TestInterface_doTest; IceInternal::OnewayCallbackNC<T>::TPtr = IceUtil::Handle<test::AMI_TestInterface_doTest>; IceInternal::OnewayCallbackNC<T>::Response = void (test::AMI_TestInterface_doTest::*)(); IceInternal::OnewayCallbackNC<T>::Exception = void (test::AMI_TestInterface_doTest::*)(const IceUtil::Exception&); Ice::Exception = IceUtil::Exception; IceInternal::OnewayCallbackNC<T>::Sent = void (test::AMI_TestInterface_doTest::*)(bool)]’:
./Test.h:504:67: required from ‘test::CallbackNC_TestInterface_doTest<T>::CallbackNC_TestInterface_doTest(const TPtr&, test::CallbackNC_TestInterface_doTest<T>::Response, test::CallbackNC_TestInterface_doTest<T>::Exception, test::CallbackNC_TestInterface_doTest<T>::Sent) [with T = test::AMI_TestInterface_doTest; test::CallbackNC_TestInterface_doTest<T>::TPtr = IceUtil::Handle<test::AMI_TestInterface_doTest>; test::CallbackNC_TestInterface_doTest<T>::Response = void (test::AMI_TestInterface_doTest::*)(); test::CallbackNC_TestInterface_doTest<T>::Exception = void (test::AMI_TestInterface_doTest::*)(const IceUtil::Exception&); Ice::Exception = IceUtil::Exception; test::CallbackNC_TestInterface_doTest<T>::Sent = void (test::AMI_TestInterface_doTest::*)(bool)]’
./Test.h:512:77: required from ‘test::Callback_TestInterface_doTestPtr test::newCallback_TestInterface_doTest(const IceUtil::Handle<Y>&, void (T::*)(), void (T::*)(const Exception&), void (T::*)(bool)) [with T = test::AMI_TestInterface_doTest; test::Callback_TestInterface_doTestPtr = IceUtil::Handle<test::Callback_TestInterface_doTest_Base>; Ice::Exception = IceUtil::Exception]’
Test.cpp:115:201: required from here
/usr/include/Ice/Proxy.h:1211:9: error: ‘checkCallback’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
/usr/include/Ice/Proxy.h:1211:9: note: declarations in dependent base ‘IceInternal::CallbackBase’ are not found by unqualified lookup
/usr/include/Ice/Proxy.h:1211:9: note: use ‘this->checkCallback’ instead

gcc --version says:
gcc (GCC) 4.7.0 20120416 (Red Hat 4.7.0-2)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This is with 64-bit Fedora 17 (beta)

MEF

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Yes we are aware of this problem with gcc 4.7 and clang which have changed the scoping rules. A fix will be included in the next Ice release (which is still few months away). In the meantime, you should be able to use the patch posted here if you need to compile Ice with gcc 4.7.

    Cheers,
    Benoit.
Sign In or Register to comment.