Results 1 to 2 of 2

Thread: slice2cpp output that won't compile

  1. #1
    record is offline Registered User
    Join Date
    Jun 2004
    Posts
    3

    Unhappy slice2cpp output that won't compile

    Here is a simple example that fails. I am running RedHat 9 with all
    patches. The problem seems to be that the __F__Control class is
    defined twice in test.cpp outside of any namespace. Thus the two Control
    classes cause the generation of conflicting names.
    I originally ran into this with the conflicting classes in two separate
    ice files. That results in a segmentation fault in a runtime static
    constructor.
    Am I breaking some Ice coding rule?
    By the way, this all works in Java.

    I am using a recent download of Ice 1.4.0. I also see this
    in 1.3.0.

    Jim

    cat test.ice

    #ifndef TEST_ICE
    #define TEST_ICE
    module A {
    class Control {
    string name;
    };
    };
    module B {
    class Control {
    double a;
    };
    };
    #endif

    slice2cpp test.ice

    c++ -v
    Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
    Thread model: posix
    gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

    c++ -g -pipe -ftemplate-depth-128 -fPIC -Wall -D_REENTRANT -I. -I$ICE_HOME/include -c test.cpp
    test.cpp:449: redefinition of `class __F__Control'
    test.cpp:286: previous definition of `class __F__Control'
    test.cpp:449: confused by earlier errors, bailing out

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi,

    Thanks for the bug report! This problem has been fixed for the next release. Until then, I've attached a patch that you can apply to correct it. Assuming you've saved the patch in the file $ICE_HOME/patch.txt, you can apply it like this:

    $ cd $ICE_HOME
    $ patch -p0 < patch.txt

    Next you need to rebuild the translator. You can do this by running make in the top-level Ice directory, but due to dependency rules the change to slice2cpp will cause everything to be rebuilt. Alternatively, you can change to the src/slice2cpp directory and run make there to build only the new translator binary.

    Take care,
    - Mark
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 11
    Last Post: 02-14-2012, 09:43 PM
  2. Replies: 5
    Last Post: 06-21-2010, 04:03 AM
  3. Replies: 3
    Last Post: 08-01-2007, 12:57 PM
  4. slice2cs - no output
    By kwaclaw in forum Help Center
    Replies: 8
    Last Post: 06-24-2005, 06:52 PM
  5. Compile error, slice2cpp, VC7
    By Kaos in forum Help Center
    Replies: 2
    Last Post: 05-06-2004, 11:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •