Assistance Needed with config.w32 and .dsp scripts

View: New views
5 Messages — Rating Filter:   Alert me  

Assistance Needed with config.w32 and .dsp scripts

by Israel Ekpo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Everyone,

My name is Israel Ekpo

I am trying to compile the Solr extension on Windows XP using Visual Studio
2008 but I am getting compile errors.

Guillaume Rossolini also tried but he is getting other errors too.

It looks like the Visual Studio compiler is unable to locate a library or
header file.

I compile it find with no issues on Linux.

Please could someone who is  familiar with building PHP 5 extensions on
Windows help us take a look at this situation.

Any help would be appreciated. Thanks.

The SVN source is available here

http://svn.php.net/repository/pecl/solr/trunk

Guillaume got this error

configure line with php-5.3-latest revision 290849 (/x86 /xp /Release ):
--disable-all --enable-cli --with-solr=yes --with-curl=yes
--with-libxml=yes

    Creating library Release_TS\php_solr.lib and object
Release_TS\php_solr.exp
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_slist_free_all referenced in function _solr_make_request
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_strerror referenced in function _solr_make_request
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_getinfo referenced in function _solr_make_request
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_perform referenced in function _solr_make_request
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_setopt referenced in function _solr_make_request
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_slist_append referenced in function _solr_make_request
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_cleanup referenced in function _solr_free_handle
solr_functions_client.obj : error LNK2019: unresolved external symbol
__imp__curl_easy_init referenced in function _solr_init_handle
Release_TS\php_solr.dll : fatal error LNK1120: 8 unresolved externals

I did not even get this far when I tried.

So any help in the form of changes/recommendations to the config.w32 and
solr.dsp scripts would be highly appreciated.

--
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.

Re: Assistance Needed with config.w32 and .dsp scripts

by Gustavo Lopes-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 17 Nov 2009 21:26:48 -0000, Israel Ekpo <israelekpo@...>  
wrote:

> http://svn.php.net/repository/pecl/solr/trunk

> solr_functions_client.obj : error LNK2019: unresolved external symbol
> __imp__curl_easy_init referenced in function _solr_init_handle
> Release_TS\php_solr.dll : fatal error LNK1120: 8 unresolved externals

> I did not even get this far when I tried.

> So any help in the form of changes/recommendations to the config.w32 and
> solr.dsp scripts would be highly appreciated.

First, it was getting unresolved externals for libxml and libcurl. nmake  
/N told me those libraries weren't being included in the command line. So  
I manually added them and re-run the command.

Then I got the same linking errors errors when using the static libcurl  
library, but when I used the dll import library the linking errors were  
gone.

I don't know how to fix config.w32 so that those libraries are included in  
the linking step. The linking problem with curl is easy: don't use  
__declspec(dllimport) when using the static lib. Those __imp_* symbols are  
an optimization the compiler uses when importing *DLL* functions. You  
could still drop __declspec(dllimport) when using the DLL, but you would  
have a small performance hit. Checking the header curl.h,  
__declspec(dllimport) can be dropped from the declarations by defining  
CURL_STATICLIB.

--
Gustavo Lopes

--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Assistance Needed with config.w32 and .dsp scripts

by Gustavo Lopes-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 18 Nov 2009 00:47:05 -0000, Gustavo Lopes <glopes@...>  
wrote:

>
> First, it was getting unresolved externals for libxml and libcurl. nmake  
> /N told me those libraries weren't being included in the command line.  
> So I manually added them and re-run the command.
>

Just a small correction. This is original command line:

         "cl.exe" Debug_TS\ext\solr\php_solr.obj  
Debug_TS\ext\solr\php_solr_clien
t.obj Debug_TS\ext\solr\php_solr_document.obj  
Debug_TS\ext\solr\php_solr_excepti
on.obj Debug_TS\ext\solr\php_solr_input_document.obj  
Debug_TS\ext\solr\php_solr_
object.obj Debug_TS\ext\solr\php_solr_params.obj  
Debug_TS\ext\solr\php_solr_quer
y.obj Debug_TS\ext\solr\php_solr_response.obj  
Debug_TS\ext\solr\php_solr_utils.o
bj Debug_TS\ext\solr\solr_functions_client.obj  
Debug_TS\ext\solr\solr_functions_
debug.obj Debug_TS\ext\solr\solr_functions_document.obj  
Debug_TS\ext\solr\solr_f
unctions_helpers.obj Debug_TS\ext\solr\solr_functions_params.obj  
Debug_TS\ext\so
lr\solr_functions_response.obj Debug_TS\ext\solr\solr_string.obj  
Debug_TS\php5ts
_debug.lib libcurl.lib ssleay32.lib libeay32.lib WinMM.Lib Wldap32.Lib  
zlib.lib
kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib  
Dnsapi.lib
  Debug_TS\php_solr.dll.res /link /out:Debug_TS\php_solr.dll /dll /nologo  
/versio
n:5.3.0 /debug /libpath:"\"no\lib\""

Actually, libcurl is here, only libxml is missing. The rest of what I've  
said is unaffected.

--
Gustavo Lopes

--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [INTERNALS-WIN] Assistance Needed with config.w32 and .dsp scripts

by Pierre Joye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

On Tue, Nov 17, 2009 at 10:26 PM, Israel Ekpo <israelekpo@...> wrote:
> Hi Everyone,
>
> My name is Israel Ekpo
>
> I am trying to compile the Solr extension on Windows XP using Visual Studio
> 2008 but I am getting compile errors.

Current trunk should work fine as long as you have libxml, curl, iconv
and zlibs deps installed. I also uploaded 5.3 vc9-x86 ts and nts
version of solr here: http://downloads.php.net/pierre/

Cheers,
--
Pierre

http://blog.thepimp.net | http://www.libgd.org

--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [INTERNALS-WIN] Assistance Needed with config.w32 and .dsp scripts

by Israel Ekpo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pierre and Pierrick,

Thanks a lot once again for helping me out!

I really really appreciate it. You have really helped out a lot of the
windows PHP user space developers that could not use the extension.

I also  thank Kalle and Felipe for their contributions in reviewing the
initial releases of the SOLR module for bugs and compatibility with C++ and
Windows compilers. I am now able to compile it without any warnings.

I will add your 4 names to the next release of the SOLR extension as the
people that made the release happen.

This has also paved way for the 1.0 release which I intentionally postponed
until it was available for the windows platform.

Once again thank you very much.

You guys rock!

On Sun, Nov 22, 2009 at 7:11 AM, Pierre Joye <pierre.php@...> wrote:

> hi,
>
> On Tue, Nov 17, 2009 at 10:26 PM, Israel Ekpo <israelekpo@...>
> wrote:
> > Hi Everyone,
> >
> > My name is Israel Ekpo
> >
> > I am trying to compile the Solr extension on Windows XP using Visual
> Studio
> > 2008 but I am getting compile errors.
>
> Current trunk should work fine as long as you have libxml, curl, iconv
> and zlibs deps installed. I also uploaded 5.3 vc9-x86 ts and nts
> version of solr here: http://downloads.php.net/pierre/
>
> Cheers,
> --
> Pierre
>
> http://blog.thepimp.net | http://www.libgd.org
>



--
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.