Re: [INTERNALS-WIN] More Extension problems with 5.3.0

[email protected] (Rob Richards)
Newsgroups php.internals.win
Message-ID <[email protected]>
Pierre Joye wrote:
> hi!
>
> On Sat, Dec 27, 2008 at 1:11 AM, Niel <[email protected]> wrote:
>
>   
>> Updated the source from cvs: dom, com_dotnet, xml, and xmlreader all
>> build statically now, mbstring still does not (see below errors).
>>     
>
> dom, simplexml, xmlwriter can be built as shared ext now. xmlreader
> and ext/xml need some love still, see below.
>
>   
>>  You
>> didn't mention pspell?
>>     
>
> pspell is dead, so it will never be available on windows.
>
>   
>> No, I already tried building them both shared and statically before
>> posting. Both methods failed with the same problem.  Also the update has
>> broken simplexml so it has errors
>>     
>
> Sounds like a cvs update may help you here. See below.
>
>   
>> Type 'nmake' to build PHP
>> D:\Dev\C\PHP\php_5_3\vc9\x86\src>nmake
>> Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
>> Copyright (C) Microsoft Corporation.  All rights reserved.
>>
>> simplexml.c
>> ext\simplexml\simplexml.c(44) : error C2491: 'sxe_get_element_class_entry' : def
>> inition of dllimport function not allowed
>>     
>
> Fixed in CVS already (for dom, simplexml, and a couple of other),
> please update your local tree and re do the buildconf, etc.
>
> XMLReader and ext/xml still need some work to be built shared.
>
> XMLReader error built as shared:
>
> EXT simplexml build complete
>    Creating library Release_TS\php_xmlreader.lib and object
> Release_TS\php_xmlreader.exp
> php_xmlreader.obj : error LNK2019: unresolved external symbol
> _xmlTextReaderSchemaValidate referenced in function
> _zim_xmlreader_setSchema
> php_xmlreader.obj : error LNK2019: unresolved external symbol
> _xmlTextReaderSetup referenced in function _zim_xmlreader_XML
> Release_TS\php_xmlreader.dll : fatal error LNK1120: 2 unresolved externals
> NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual
> Studio 9.0\VC\Bin\cl.exe"' : return code '0x2'
> Stop.
>
>
>   
>> mbstring tries to build shared even though it is not told to.
>>     
>
> I did not try it yet (with your configure options).
>
>   

Pierre,

I was forced to always export the simplexml functions. It appears the 
win32 build system only adds a _EXPORTS flag when the extension is build 
as shared. I think that flag always needs to be added when an extension 
is being built so that it can be used in the headers to detect whether a 
function should be imported or exported. For now I set it to always 
export so that it works both statically and shared now and am letting 
the compiler force an import when appropriate - not 100% clean but works 
around the build issue.

We can either go the route of iconv and always add an _EXPORTS flag when 
building the extension, or change the win build system to do it for all 
extensions. I think the current behavior of adding it only when shared 
is left over form the old dsp days.

Rob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.