Thread overview
Unresolved symbols when program imports std.regex
Dec 22, 2011
GrahamC
Dec 23, 2011
Trass3r
Dec 23, 2011
Iain Buclaw
Dec 23, 2011
GrahamC
December 22, 2011
If I import std.regex in a program, compiling with gdc gives many unresolved symbols, e.g for:
  immutable(std.internal.uni.CodepointSet) std.internal.uni_tab.unicodeLu
  ref @safe std.internal.uni.CodepointSet std.internal.uni.CodepointSet.add(const(std.internal.uni.CodepointSet))
plus many others.

If I include additional modules on the compilation command line like this:

gdc test.d /opt/gdc/include/d2/4.6.2/std/internal/uni.d /opt/gdc/include/d2/4.6.2/std/internal/uni_tab.d

where test.d is my program, all symbols resolve OK.

Does this indicate a problem in the building of libgphobos2.a or have I made a mistake in configuring gdc
prior to compiling it ? I don't see any open issues listed for regex on https://bitbucket.org/goshawk/gdc/issues

gdc -v gives:
Using built-in specs.
COLLECT_GCC=gdc
COLLECT_LTO_WRAPPER=/opt/gdc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-languages=d --enable-checking=release --disable-shared --disable-nls --prefix=/opt/gdc --with-bugurl=https://bitbucket.org/goshawk/gdc/issues --disable-libgomp --disable-libmudflap --enable-multilib --enable-nls
Thread model: posix
gcc version 4.6.2 20111026 (gdc 0.30, using dmd 2.057) (GCC)

My platform is Linux 3.1.5-6.fc16.x86_64

December 23, 2011
> If I include additional modules on the compilation command line like this:
>
> gdc test.d /opt/gdc/include/d2/4.6.2/std/internal/uni.d /opt/gdc/include/d2/4.6.2/std/internal/uni_tab.d
>
> where test.d is my program, all symbols resolve OK.
>
> Does this indicate a problem in the building of libgphobos2.a or have I made a mistake in configuring gdc
> prior to compiling it ? I don't see any open issues listed for regex on

Yeah, looks like the phobos lib is missing these.
Did you properly update, i.e. with gcc/d/setup-gcc.sh -v2 --update?
December 23, 2011
On 23 December 2011 13:40, Trass3r <un@known.com> wrote:
>> If I include additional modules on the compilation command line like this:
>>
>> gdc test.d /opt/gdc/include/d2/4.6.2/std/internal/uni.d /opt/gdc/include/d2/4.6.2/std/internal/uni_tab.d
>>
>> where test.d is my program, all symbols resolve OK.
>>
>> Does this indicate a problem in the building of libgphobos2.a or have I
>> made a mistake in configuring gdc
>> prior to compiling it ? I don't see any open issues listed for regex on
>
>
> Yeah, looks like the phobos lib is missing these.
> Did you properly update, i.e. with gcc/d/setup-gcc.sh -v2 --update?

You should also remove / clean at least the GDC and Phobos directories prior to rebuilding post upgrade too.

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
December 23, 2011
>> If I include additional modules on the compilation command line like this:
>>
>> gdc test.d /opt/gdc/include/d2/4.6.2/std/internal/uni.d /opt/gdc/include/d2/4.6.2/std/internal/uni_tab.d
>>
>> where test.d is my program, all symbols resolve OK.
>>
>> Does this indicate a problem in the building of libgphobos2.a or have I made a mistake in configuring gdc prior to compiling it ? I don't see any open issues listed for regex on

> Yeah, looks like the phobos lib is missing these.
> Did you properly update, i.e. with gcc/d/setup-gcc.sh -v2 --update?



Yes, I did this, I notice there are two modules named uni.d :

./d/phobos2/std/internal/uni.d
./d/phobos2/std/uni.d


If I manually compile and add the first to libgphobos2.a I have to rename the .o file first to prevent it overwriting the object module of the latter one. So maybe this is the problem in the library build process - only one of them ends up in the library.