digitalmars.D.bugs - unbox!(char[]) fails with linker error.
- Fredrik Olsson (26/26) Aug 04 2005 Hi.
- Victor Nakoryakov (6/41) Aug 05 2005 This is a bug and it already added to DStress.
- Fredrik Olsson (7/49) Aug 05 2005 Good.
- Hasan Aljudy (14/67) Aug 05 2005 I would assume you can write something like this:
- Hasan Aljudy (3/78) Aug 05 2005 woops, I meant:
Hi. This tiny test: // !!! Begin unboxfail.d !!! import std.boxer; import std.stdio; int main(char[][]args) { Box b = box("Hello World"); if (unboxable!(char[])(b)) { writefln(unbox!(char[])(b)); // !!! Fails !!! return 0; } else { return 1; } } !!! End unboxfail.d Compiled with: gdc unboxfail.d -o unboxfail Gives this error message: ld: Undefined symbols: __init_11TypeInfo_Pv I use gdc 0.15 installed from Anders F Björklund's package for Mac OS X. I run under Mac OS X 1.4.2. Is there a special trick to unboxing arrays, or have I stumbled upon a bug? regards Fredrik Olsson
Aug 04 2005
Fredrik Olsson wrote:Hi. This tiny test: // !!! Begin unboxfail.d !!! import std.boxer; import std.stdio; int main(char[][]args) { Box b = box("Hello World"); if (unboxable!(char[])(b)) { writefln(unbox!(char[])(b)); // !!! Fails !!! return 0; } else { return 1; } } !!! End unboxfail.d Compiled with: gdc unboxfail.d -o unboxfail Gives this error message: ld: Undefined symbols: __init_11TypeInfo_Pv I use gdc 0.15 installed from Anders F Björklund's package for Mac OS X. I run under Mac OS X 1.4.2. Is there a special trick to unboxing arrays, or have I stumbled upon a bug? regards Fredrik OlssonThis is a bug and it already added to DStress. -- Victor (aka nail) Nakoryakov nail-mail<at>mail<dot>ru Krasnoznamensk, Moscow, Russia
Aug 05 2005
Victor Nakoryakov wrote:Fredrik Olsson wrote:Good. Is there a work-around that can be used in the mean time (I need to box and unbox int, float, char[] and my own class Block and it's decendant ContainerBlock only). Regards Fredrik OlssonHi. This tiny test: // !!! Begin unboxfail.d !!! import std.boxer; import std.stdio; int main(char[][]args) { Box b = box("Hello World"); if (unboxable!(char[])(b)) { writefln(unbox!(char[])(b)); // !!! Fails !!! return 0; } else { return 1; } } !!! End unboxfail.d Compiled with: gdc unboxfail.d -o unboxfail Gives this error message: ld: Undefined symbols: __init_11TypeInfo_Pv I use gdc 0.15 installed from Anders F Björklund's package for Mac OS X. I run under Mac OS X 1.4.2. Is there a special trick to unboxing arrays, or have I stumbled upon a bug? regards Fredrik OlssonThis is a bug and it already added to DStress.
Aug 05 2005
Fredrik Olsson wrote:Victor Nakoryakov wrote:I would assume you can write something like this: <code> class StringBox { this( char str[] ) { // .. do something to encapsulate str into this object } } Box x = ( new StringBox("HelloWorld") ); </code> i.e. write a small class or struct that hides the string, and then box that class and unbox it.Fredrik Olsson wrote:Good. Is there a work-around that can be used in the mean time (I need to box and unbox int, float, char[] and my own class Block and it's decendant ContainerBlock only). Regards Fredrik OlssonHi. This tiny test: // !!! Begin unboxfail.d !!! import std.boxer; import std.stdio; int main(char[][]args) { Box b = box("Hello World"); if (unboxable!(char[])(b)) { writefln(unbox!(char[])(b)); // !!! Fails !!! return 0; } else { return 1; } } !!! End unboxfail.d Compiled with: gdc unboxfail.d -o unboxfail Gives this error message: ld: Undefined symbols: __init_11TypeInfo_Pv I use gdc 0.15 installed from Anders F Björklund's package for Mac OS X. I run under Mac OS X 1.4.2. Is there a special trick to unboxing arrays, or have I stumbled upon a bug? regards Fredrik OlssonThis is a bug and it already added to DStress.
Aug 05 2005
Hasan Aljudy wrote:Fredrik Olsson wrote:woops, I meant: #Box b = box( new StringBox("HelloWorld") );Victor Nakoryakov wrote:I would assume you can write something like this: <code> class StringBox { this( char str[] ) { // .. do something to encapsulate str into this object } } Box x = ( new StringBox("HelloWorld") ); </code> i.e. write a small class or struct that hides the string, and then box that class and unbox it.Fredrik Olsson wrote:Good. Is there a work-around that can be used in the mean time (I need to box and unbox int, float, char[] and my own class Block and it's decendant ContainerBlock only). Regards Fredrik OlssonHi. This tiny test: // !!! Begin unboxfail.d !!! import std.boxer; import std.stdio; int main(char[][]args) { Box b = box("Hello World"); if (unboxable!(char[])(b)) { writefln(unbox!(char[])(b)); // !!! Fails !!! return 0; } else { return 1; } } !!! End unboxfail.d Compiled with: gdc unboxfail.d -o unboxfail Gives this error message: ld: Undefined symbols: __init_11TypeInfo_Pv I use gdc 0.15 installed from Anders F Björklund's package for Mac OS X. I run under Mac OS X 1.4.2. Is there a special trick to unboxing arrays, or have I stumbled upon a bug? regards Fredrik OlssonThis is a bug and it already added to DStress.
Aug 05 2005