473,467 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

internal compiler error line 2701 : union issue

I am using Ghost Lib 4.0,
which is SDK for Phantom haptic device.

this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};

is there some known fixes to this, which would not lead to this union
structure modification ? (I cannot afford to rewrite this library as I
do not have its sources)

thanks to anyone who may help.

Sebastien MARAUX
Nov 17 '05 #1
4 1963
>this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};


Sebastien,

What's the error message you're getting?

Which version of the compiler are you using?

Dave
Nov 17 '05 #2
sebastien NO Maraux SPAM <ma****@ondim.fr> wrote:
I am using Ghost Lib 4.0,
which is SDK for Phantom haptic device.

this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};
It must be something in the code you
don't show. This

union A {
union A* aList;
char b[1];
};

int main()
{
return 0;
}

compiles just fine for me with VC7.1. Try
to reduce the problem to <50LOC that we can
copy'n'paste into our editor.
Generally, I found VC7.1 ICE mostly on "real"
errors, where in other circumstances it would
emit a sensible error message for.
[...]
Sebastien MARAUX

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
Nov 17 '05 #3
here is the exact error message :

c:\Program Files\SensAble\GHOST\v4.0\external\stl\stl_alloc.h (308):
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information

13 times when compiling my program.

I am compiling a Phantom server from VRPN soft based on ghost SDK
(Phantom Desktop SDK). Seems an issue with GHOST re-declaring its own
stl headers (map, list, string and much more)

ghost stl headers seem to have been given from SGI, reditributable
without fees so I can provide it to whoever wants it (280ko without
complete ghost lib which is copyrighted). the issue is on stl_alloc.h
in this class,
at union _Obj* _M_free_list_link;

//-----------------------------------------------------------

template <bool threads, int inst>
class __default_alloc_template {

private:
// Really we should use static const int x = N
// instead of enum { x = N }, but few compilers accept the former.
# ifndef __SUNPRO_CC
enum {_ALIGN = 8};
enum {_MAX_BYTES = 128};
enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
# endif
static size_t
_S_round_up(size_t __bytes)
{ return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN -
1)); }

__PRIVATE:
union _Obj {
union _Obj* _M_free_list_link;
char _M_client_data[1]; /* The client sees this. */
};
//--------------------------------------------------------------------

This works under VC++ 6 (SP5 and probably before), but STL Re
declaration seems to disturb .net 2003 more than 6.0.
"Hendrik Schober" <Sp******@gmx.de> wrote in message news:<eB**************@TK2MSFTNGP09.phx.gbl>...
sebastien NO Maraux SPAM <ma****@ondim.fr> wrote:
I am using Ghost Lib 4.0,
which is SDK for Phantom haptic device.

this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};


It must be something in the code you
don't show. This

union A {
union A* aList;
char b[1];
};

int main()
{
return 0;
}

compiles just fine for me with VC7.1. Try
to reduce the problem to <50LOC that we can
copy'n'paste into our editor.
Generally, I found VC7.1 ICE mostly on "real"
errors, where in other circumstances it would
emit a sensible error message for.
[...]
Sebastien MARAUX

Schobi

Nov 17 '05 #4
sebastien NO Maraux SPAM <ma****@ondim.fr> wrote:
[...]
I am compiling a Phantom server from VRPN soft based on ghost SDK
(Phantom Desktop SDK). Seems an issue with GHOST re-declaring its own
stl headers (map, list, string and much more)
You mean it _comes_ with its own STL
headers?
ghost stl headers seem to have been given from SGI, reditributable
without fees so I can provide it to whoever wants it (280ko without
complete ghost lib which is copyrighted).
Have you tried to use the Dinkumware
headers instead???
the issue is on stl_alloc.h
in this class,
at union _Obj* _M_free_list_link;

//-----------------------------------------------------------

template <bool threads, int inst>
class __default_alloc_template {

private:
// Really we should use static const int x = N
// instead of enum { x = N }, but few compilers accept the former.
# ifndef __SUNPRO_CC
enum {_ALIGN = 8};
enum {_MAX_BYTES = 128};
enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
# endif
static size_t
_S_round_up(size_t __bytes)
{ return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN -
1)); }

__PRIVATE:
union _Obj {
union _Obj* _M_free_list_link;
char _M_client_data[1]; /* The client sees this. */
};
//--------------------------------------------------------------------
This itself, if I add the missing brace,
compiles fine for me, even if I instanciate
the template. Again, it's somewhere in the
code you didn'nt post.
This works under VC++ 6 (SP5 and probably before), but STL Re
declaration seems to disturb .net 2003 more than 6.0.
The code style does look like STLport (or
the SGI STL, which STLport is derived from).
I seriously doubt that many people have put
effort into getting this to compile with
VC7.1, as the Dinkumware lib coming with it
really is at least as good, most probably
better.
However, I wonder why some 3rd-party code
would come with its own STL. All compilers
come with their std lib nowadays, so there
really is no need for and much potential
harm in adding another one to that. Can't
you just throw the other one away and try
to get the stuff to compile with Dinkumware?
If the code doesn't use too many SGI STL-
specific extensions, this seems the way to
go.
[...]

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
11
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
1
by: Andrew Ward | last post by:
Had an internal compiler error if anyone at MS is interested. Line 7 was a forward declaration of a class, more specifically: class SchematicSpecID; The error went away when I moved the...
5
by: Michael Kennedy [UB] | last post by:
Hi, I would like to report some weird behavior which results in an internal compiler error in VS.NET 2003 (VC++). I have an ATL COM dll project which also uses MFC. This solution (workspace...
6
by: David Lack | last post by:
Hi, I recently installed a 60-day trial of .NET 2003 on my development system. I made tests with previous personal projects (which compiled ok with VC6) and some open source files, and keep...
9
by: Marco Nova | last post by:
Hello I'm using the latest version of Visual Studio 2003 version 7.1.3088, .net framework 1.1.4322 and I've some problem compiling a project, it give me the error ...
2
by: Darren Martz | last post by:
Compiler: msvc 7.1 AppType: console OS: WinXP Pro I now get this "Internal Compiler Error mscl.cpp line 2701" message when I build a specific project and cannot figure out why. It was...
1
by: pHines | last post by:
I have my entire source code directory available on my laptop via Offline Files. The directory structure is housed on my server and made available offline on the laptop using Windows 2000. When I...
1
by: kvarada | last post by:
Hello Experts, I am building my application on WinNT.4.0_i386_MSVC.7.1 platform. When I build the application on a stand alone machine, it builds fine. But when I build the same application from a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.