www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Error 42: Symbol Undefined __tls_array

reply Robert <robert.muench robertmuench.de> writes:
What are these undefined symbols? I don't use any __tls_array stuff or 
so. I have a "char[]" array in may code but nothing more. And I import 
core.runtime as I compile a DLL.

OPTLINK (R) for Win32  Release 8.00.2
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
ext-test.obj(ext-test)
 Error 42: Symbol Undefined __tls_array
ext-test.obj(ext-test)
 Error 42: Symbol Undefined __tls_index
--- errorlevel 2

-- 
Robert M. Münch
http://www.robertmuench.de
Jun 03 2010
next sibling parent Robert <robert.muench robertmuench.de> writes:
On 2010-06-03 21:36:18 +0200, Robert <robert.muench robertmuench.de> said:

 What are these undefined symbols? I don't use any __tls_array stuff or 
 so. I have a "char[]" array in may code but nothing more. And I import 
 core.runtime as I compile a DLL.
Somehow the compiler doesn't link phobos.lib. Not sure why because the compiler dir is in my PATH and SC.INI is in the compiler directory, where the path to the lib is defined relatively... -- Robert M. Münch http://www.robertmuench.de
Jun 03 2010
prev sibling next sibling parent reply BLS <windevguy hotmail.de> writes:
On 03/06/2010 21:36, Robert wrote:
 What are these undefined symbols? I don't use any __tls_array stuff or
 so. I have a "char[]" array in may code but nothing more. And I import
 core.runtime as I compile a DLL.

 OPTLINK (R) for Win32 Release 8.00.2
 Copyright (C) Digital Mars 1989-2009 All rights reserved.
 http://www.digitalmars.com/ctg/optlink.html
 ext-test.obj(ext-test)
 Error 42: Symbol Undefined __tls_array
 ext-test.obj(ext-test)
 Error 42: Symbol Undefined __tls_index
 --- errorlevel 2
to be honest with you, this is just a guess... what about : __gshared char[] x; bjoern
Jun 04 2010
parent reply =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench robertmuench.de> writes:
On 2010-06-05 02:34:10 +0200, BLS said:
 
 to be honest with you, this is just a guess...
 what about :
 __gshared char[] x;
 
 bjoern

Ah, didn't saw this. I have a global static char[] but will try to use immutable and see if this helps. -- Robert M. Münch http://www.robertmuench.de
Jun 05 2010
parent BLS <windevguy hotmail.de> writes:
On 05/06/2010 13:01, Robert M. Münch wrote:
 On 2010-06-05 02:34:10 +0200, BLS said:
 to be honest with you, this is just a guess...
 what about :
 __gshared char[] x;

 bjoern

Ah, didn't saw this. I have a global static char[] but will try to use immutable and see if this helps.
Please let me know what you have figured out. have to deal with WIN API TlsAlloc stuff and I am a bit confused on how to bring D TLS and WIN TLS under one hood. Guess it's the Tls API indexing thing I can't get.. TIA bjoern
Jun 05 2010
prev sibling parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
The thread local storage symbols will always creep in, because they are 
used by the phobos initialization.

IIRC the definition for the symbols is not in phobos, but in snn.lib, 
the C runtime library.

Are you following http://www.digitalmars.com/d/2.0/dll.html ?

The "DLL with a C Interface" works fine for me, but the "D code calling 
D code in DLLs" is rather old, if not broken. I've proposed

http://d.puremagic.com/issues/show_bug.cgi?id=4071

so all phobos objects and the GC can be shared between DLLs.


Robert wrote:
 What are these undefined symbols? I don't use any __tls_array stuff or 
 so. I have a "char[]" array in may code but nothing more. And I import 
 core.runtime as I compile a DLL.
 
 OPTLINK (R) for Win32  Release 8.00.2
 Copyright (C) Digital Mars 1989-2009  All rights reserved.
 http://www.digitalmars.com/ctg/optlink.html
 ext-test.obj(ext-test)
 Error 42: Symbol Undefined __tls_array
 ext-test.obj(ext-test)
 Error 42: Symbol Undefined __tls_index
 --- errorlevel 2
 
Jun 04 2010
parent =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench robertmuench.de> writes:
On 2010-06-05 08:39:04 +0200, Rainer Schuetze said:

 Are you following http://www.digitalmars.com/d/2.0/dll.html ?
Yes, creating a DLL in D that has a C callinterface.
 The "DLL with a C Interface" works fine for me,
That's what I have used. But as posted I had to add the phobos.lib explicitly to the compile command. -- Robert M. Münch http://www.robertmuench.de
Jun 05 2010