develooper Front page | perl.perl5.porters | Postings from November 2005

Undefined Symbol on MinGW

Thread Next
Timm Murray
November 28, 2005 09:20
Undefined Symbol on MinGW
Message ID:
I have perl-5.8.7 built with MinGW and I've been trying to get SDL_perl to 
build against it.  I think I've narrowed the issue down to a problem during 
the Perl build process.

The main SDL_perl DLL is being linked with this command

g++ -o "blib\arch\auto\SDL_perl\SDL_perl.dll" 
-Wl,--image-base,0x23210000 -mdll -s "src\"
"blib\arch\auto\SDL_perl\SDL_perl.exp" -Le:\perl-5.8.7\lib\CORE
-Le:\msys\1.0\mingw\lib -lmingw32 -lSDLmain -lSDL

Which gives this error:

blib\arch\auto\SDL_perl\SDL_perl.exp(.edata+0x50):fake: undefined reference to
blib\arch\auto\SDL_perl\SDL_perl.exp(.edata+0x54):fake: undefined reference to
collect2: ld returned 1 exit status

Using nm, I cannot find a library on my system that has a 'boot_' symbol.

The linking command references the SDL_perl.exp file, which in turn is created 
from SDL_perl.def by dlltool.  The .def file is created using 
ExtUtils::Mksymlists.  This file looks like this:

  _boot_ = boot_

That boot seems to be inserted by this line in ExtUtils::Mksymlists (around 
line 40):

push(@{$spec{FUNCLIST}},"boot_$packprefix") unless $bootseen;

If $packprefix was an empty string here, it would put "boot_" into the array, 
which eventually gets put in the file seen above.

Mksymlists seems to get an empty $packprefix because of an entry in 

static_ext=' '

A mailing list thread for Cygwin shows a very similar problem:

The explaination there was that static_ext gets split according to Perl's 
rules, which ends up putting in an empty string, which eventually gets 
translated to 'boot_' as seen above.  I'm not sure of the details beyond 
that, but it seems to work out.

So how do I get Perl to stop creating this 'boot_' entry?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About