Re: CPAN Upload: A/AB/ABERGMAN/ponie-2.tar.gz - Ponie Development Release 2
[email protected] (Steve Hay) Mon, 29 Mar 2004 12:32:33 +0100
| Newsgroups | perl.ponie.dev |
|---|---|
| Message-ID | <[email protected]> |
Steve Hay wrote:
> The parrot build nearly worked OK now, but unfortunately it fell at
> the last hurdle:
>
> link -out:parrot.exe -nologo -nodefaultlib -debug
> -machine:x86 -debug imcc\main.obj blib/lib/libparrot_s.lib
> oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
> comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
> netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib
> odbc32.lib odbccp32.lib msvcrt.lib
> libparrot_s.lib(perl5xpvhv.obj) : error LNK2001: unresolved external
> symbol __imp__win32_malloc
> libparrot_s.lib(perl5lv.obj) : error LNK2001: unresolved external
> symbol __imp__win32_malloc
> libparrot_s.lib(perl5av.obj) : error LNK2001: unresolved external
> symbol __imp__win32_malloc
> libparrot_s.lib(perl5xpvhv.obj) : error LNK2001: unresolved external
> symbol __imp__win32_abort
> libparrot_s.lib(perl5lv.obj) : error LNK2001: unresolved external
> symbol __imp__win32_abort
> libparrot_s.lib(perl5av.obj) : error LNK2001: unresolved external
> symbol __imp__win32_abort
> libparrot_s.lib(perl5xpvhv.obj) : error LNK2001: unresolved external
> symbol __imp__win32_printf
> libparrot_s.lib(perl5av.obj) : error LNK2001: unresolved external
> symbol __imp__win32_printf
> parrot.exe : fatal error LNK1120: 3 unresolved externals
> NMAKE : fatal error U1077: 'link' : return code '0x460'
> Stop.
>
> I've seen this sort of name munging problem on Win32 before, but I
> can't quite figure out what's wrong here. I think it's usually
> something to do with object files or libraries that were compiled
> using different MS C run-time libraries being linked together, but as
> far as I can see everything was compiled with the same options. Those
> options include -MD, which is correct for linking against msvcrt.lib.
Doh! It's nothing to do with name mangling -- the problem is much
simpler than that! win32_malloc etc are not MS C runtime functions at
all -- they're defined in Perl's win32/win32.c. (The __imp__ decoration
just means that the linker is looking for these functions in a DLL's
import library.) The problem was simply that no Perl library is being
linked against!
I re-ran parrot's Configure.pl like this:
perl Configure.pl "--ccflags= :add{ -I../../perl -I../../perl/win32
-I../../perl/win32/include}" "--linkflags= :add{
-LIBPATH:C:/perl/lib/CORE}" "--libs= :add{ perl59.lib}"
and now parrot builds OK. Is this right? I'm using the non-ponie-perl
there, of course, because I haven't built the ponie one yet...
Now onto building the Perl part of Ponie...
I had to hack the win32/Makefile to put parrot's include and lib
settings in place:
INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I..\..\parrot\include
LIBFILES = $(LIBBASEFILES) $(LIBC) libparrot_s.lib
LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
-libpath:"$(INST_COREDIR)" -libpath:..\..\parrot\blib\lib \
-machine:$(PROCESSOR_ARCHITECTURE)
I then got some warnings out of the linker when building miniperl.exe:
link -subsystem:console -out:..\miniperl.exe
@C:\DOCUME~1\steveh\LOCALS~1\Temp\nma02956.
Creating library ..\miniperl.lib and object ..\miniperl.exp
LINK : warning LNK4049: locally defined symbol "_win32_malloc" imported
LINK : warning LNK4049: locally defined symbol "_win32_abort" imported
LINK : warning LNK4049: locally defined symbol "_win32_printf" imported
(this must be related to the linker problems that I had above when
building parrot), but sadly the build failed later on when compiling
perllib.c:
cl -c -I. -nologo -Gf -W3 -I..\lib\CORE -I.\include -I. -I..
-I..\..\parrot\include -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT
-DPERLDLL -DPERL_CORE -MD -DNDEBUG -O1 -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -TP -GX
-Foperllib.obj perllib.c
perllib.c
..\..\parrot\include\parrot/interpreter.h(59) : error C2040:
'Parrot_Interp' : 'struct Parrot_Interp *' differs in levels of
indirection from 'struct Parrot_Interp'
..\lib\CORE\intrpvar.h(535) : error C2079: 'IParrot' uses undefined
struct 'Parrot_Interp'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
The second error is presumably a consequence of the first; the first
must be something that the MSVC++ compiler doesn't like. interpreter.h
line 59 is this:
typedef struct Parrot_Interp *Parrot_Interp;
How can I get around this problem?
- Steve
------------------------------------------------
Radan Computational Ltd.
The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.