Archived

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

slice2js fails

Hello,

when i execute the slice y get this error and I don0t know how to solve it:

$ slice2js Printer.ice
slice2js: symbol lookup error: slice2js: undefined symbol: _ZNK5Slice9Container17hasOnlyClassDeclsEv


Does anyone hot to fix it??

Thanks so much

Ivan

Comments

  • mes
    mes California
    Welcome Ivan.

    We need more information in order to provide any help. Are you using the Ice for JavaScript preview release, or Ice 3.6beta? Which OS are you running?

    Regards,
    Mark
  • Thanks for your prompt answer Mark,

    I am using Ubuntu 14.04 and Ice for JavaScript preview release.

    Regards,

    Ivan
  • mes
    mes California
    Did you download one of our archives with pre-compiled Ubuntu binaries, or did you compile the source yourself?

    The slice2js executable depends on two shared libraries: libIceUtil.so and libSlice.so. It's possible that other versions of these libraries are already present on your machine and slice2js is attempting to use these instead of the ones included with the Ice for JavaScript distribution.

    Run ldd slice2js and examine the output carefully to see the path names it's using for libIceUtil and libSlice. You may need to set LD_LIBRARY_PATH to force slice2js to find the correct libraries.

    Regards,
    Mark
  • At first i downloaded your pre-compiled Ubuntu libraries but cause I had the error then I reinstaled ir compiling ir by myself.

    This is what I get if I run ldd slice2js (I have to run it in the installation path because in other place I got "ldd: ./slice2js: Does not exist the file or directory"):
    $ /opt/IceJS-0.1.0/bin$ ldd slice2js
    	linux-vdso.so.1 =>  (0x00007ffd6d51b000)
    	libSlice.so.35 => /opt/Ice-3.5.1/lib/libSlice.so.35 (0x00007f1b6b8b5000)
    	libIceUtil.so.35 => /opt/Ice-3.5.1/lib/libIceUtil.so.35 (0x00007f1b6b63b000)
    	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1b6b314000)
    	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1b6b0fe000)
    	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1b6aedf000)
    	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1b6ab1a000)
    	libmcpp.so.0 => /usr/lib/x86_64-linux-gnu/libmcpp.so.0 (0x00007f1b6a891000)
    	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1b6a688000)
    	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1b6a382000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007f1b6bc9c000)
    

    I configured the .bashrc:

    # ICE JS lines
    export ICE_JS_HOME=/opt/IceJS-0.1.0
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ICE_JS_HOME}/lib
    export PATH=${PATH}:${ICE_JS_HOME}/bin

    export CPLUS_INCLUDE_PATH=${ICE_JS_HOME}/include

    #ICE 3.5 lines
    export ICE_HOME=/opt/Ice-3.5.1
    export LD_LIBRARY_PATH=${ICE_HOME}/lib:${LD_LIBRARY_PATH}
    export PATH=${ICE_HOME}/bin:${PATH}


    Thanks so much!

    Ivan
  • mes
    mes California
    From the ldd output, it appears that slice2js is using the shared libraries from /opt/Ice-3.5.1 and not the ones from /opt/IceJS-0.1.0. The order of the directories in LD_LIBRARY_PATH affects this behavior.

    The problem is that the two library directories (/opt/Ice-3.5.1/lib and /opt/IceJS-0.1.0/lib) contain incompatible libraries, so having both in your LD_LIBRARY_PATH is probably not a good idea.

    There are a couple of ways you could fix this. First, you could create a shell script that runs slice2js with the correct LD_LIBRARY_PATH. Another possibility is to download Ice 3.6beta and use that instead. The beta is quite stable already and you can use it to replace both IceJS 0.1.0 and Ice 3.5.1.

    Regards,
    Mark
  • Thanks so much Mark, I've upgraded my application from ice35 and now works perfect!!

    Thanks for your help!!

    Ivan