Archived

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

Forward is not defined

Hi.

I'm stuck with forward ( I guess ) declarations not being compiled. Please, have a look at the following output:

../../../../../cpp/bin/slice2cs --output-dir generated -I. TestAMD.ice
/tmp/zrb/Ice-3.5b/cs/test/Ice/slicing/objects/TestAMD.ice:153: `Forward' is not defined
make[4]: *** [generated/TestAMD.cs] Error 1

Could you please share your thoughts on this.

Regards,
Dmitry N. Medvedev

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Forward is forwarded declared in TestAMD.ice:
    class Forward;          // Forward-declared class defined in another compilation unit
    

    Did you build mcpp yourself and did you apply the required patches? The patches are included in the 3rd party source archive available on our web site here.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    Forward is forwarded declared in TestAMD.ice:
    class Forward;          // Forward-declared class defined in another compilation unit
    

    Did you build mcpp yourself and did you apply the required patches? The patches are included in the 3rd party source archive available on our web site here.

    Cheers,
    Benoit.

    Thank you, Benoit for quick response.
    I actually did not. My fault, sorry.

    Now, python for Ice stopped with this:
    g++ -shared -Wl,--enable-new-dtags -Wl,-rpath,/opt/Ice-3.5b/lib64 -rdynamic -m64 -Wall -D_REENTRANT -fPIC -g  -L../../python -o ../../python/IcePy.so.3.5b -Wl,-h,IcePy.so.35b   Communicator.o Connection.o ConnectionInfo.o Current.o Endpoint.o EndpointInfo.o ImplicitContext.o Init.o Logger.o ObjectAdapter.o ObjectFactory.o Operation.o Properties.o PropertiesAdmin.o Proxy.o Slice.o Thread.o Types.o Util.o -L/opt/Ice-3.5b/lib -lIce -lSlice -lIceUtil -L/usr/local/lib/python3.3/config-3.3m -lpython3.3m  -lpthread -lrt
    /usr/bin/ld: cannot find -lIce
    

    I have downloaded and build python 3.3 from sources.
    I have compiled Ice 3.5b from sources.
    I have also created symlink /opt/Ice-3.5b/lib64 to /opt/Ice-3.5b/lib.
    I have exported LD_LIBRARY_PATH containing the /opt/Ice-3.5b/lib64.

    OS: Debian Squeeze x64 ( yes, I know it's unsupported but I like it, sorry for this )
  • Same problem seen

    I'm building 3.5.1 source on Amazon Linux. Third-party pre-reqs, cpp and py code built fine. I applied mcpp patch:
    $ patch -p0 < ../mcpp/patch.mcpp.2.7.2
    patching file ./noconfig/vc2010.dif
    patching file ./src/internal.H
    patching file ./src/main.c
    patching file ./src/support.c
    patching file ./src/system.c
    

    Py testing failed later:
    starting ServerAMD.py... Traceback (most recent call last):
      File "/home/dev/provision/Ice-3.5.1/py/test/Ice/slicing/objects/run.py", line 31, in 
    
    <module>
        TestUtil.clientServerTest(server="ServerAMD.py")
      File "/home/dev/provision/Ice-3.5.1/scripts/TestUtil.py", line 1309, in clientServerTest
        serverProc = spawnServer(server, env = serverenv, lang=serverCfg.lang, mx=serverCfg.mx)
      File "/home/dev/provision/Ice-3.5.1/scripts/TestUtil.py", line 1125, in spawnServer
        server.expect("[^\n]+ ready\n")
      File "/home/dev/provision/Ice-3.5.1/scripts/Expect.py", line 399, in expect
        raise e
    Expect.TIMEOUT: timeout exceeded in match
    pattern: "[^\n]+ ready\n"
    buffer: "/home/dev/provision/Ice-3.5.1/py/test/Ice/slicing/objects/TestAMD.ice:153: 
    
    `Forward\' is not defined
    Traceback (most recent call last):
      File \"/home/dev/provision/Ice-3.5.1/py/test/Ice/slicing/objects/ServerAMD.py\", line 14, 
    
    in <module>
        Ice.loadSlice(\'-I. --all ServerPrivateAMD.ice Forward.ice\')
    RuntimeError: Slice parsing failed for `-I. --all ServerPrivateAMD.ice Forward.ice\'
    "
    
    ('test in /home/dev/provision/Ice-3.5.1/py/test/Ice/slicing/objects failed with exit 
    
    status', 256)
    

    Fixed by adding
    #include <Forward.ice>
    
    to top of test/Ice/slicing/objects/TestAMD.ice and restarting tests.

    I also experienced the same lib path failure as Dmitry but in my case it was fixed by symlinking lib to lib64.

    David Hinson
  • benoit
    benoit Rennes, France
    Hi,

    It sounds like the libSlice library doesn't include the fix for mcpp (removing the comment line 69 in TestAMD.ice should also workaround the problem... a bug in mcpp). Did you rebuild mcpp after applying the patch and can you ensure that libSlice was correctly linked with your libmcpp build?

    Note that we also provide binaries for Amazon Linux on our download page.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    It sounds like the libSlice library doesn't include the fix for mcpp (removing the comment line 69 in TestAMD.ice should also workaround the problem... a bug in mcpp). Did you rebuild mcpp after applying the patch and can you ensure that libSlice was correctly linked with your libmcpp build?

    Note that we also provide binaries for Amazon Linux on our download page.

    Cheers,
    Benoit.

    I found the root of the problem on my end. libmcpp 2.7.2 had already been installed as a yum dependency of a different project into /usr/lib64. Since the Ice third party build puts it in /usr/local by default the patched lib was being eclipsed by the one in /usr/lib64. I yum removed libmcpp, cleaned and rebuilt everything with mcpp additionally configured with --prefix=/usr, and backed out the change I had made to test/Ice/slicing/objects/TestAMD.ice and then py tested ok.

    I appreciate your Amazon Linux binaries and was tempted to use them but I'm a control freak when it comes to third party code even when it's punishing. Ice is actually a joy to build compared to many other large products.

    Thanks for your help,

    David Hinson