Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 06-25-2004
record 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
Reply With Quote
  #2 (permalink)  
Old 06-25-2004
mes's Avatar
mes mes is online now
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 967
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
File Type: txt patch.txt (2.6 KB, 181 views)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
slice2freeze correct header with --output-dir option acbell Patches 9 11-29-2005 12:56 PM
Java Object Output Stream and Ice brian Help Center 8 10-31-2005 10:18 AM
slice2cs - no output kwaclaw Help Center 8 06-24-2005 06:52 PM
Redirecting icepacknode output Nis Baggesen Help Center 2 02-23-2005 03:56 PM
Compile error, slice2cpp, VC7 Kaos Help Center 2 05-06-2004 11:22 AM


All times are GMT -4. The time now is 12:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.