cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl (perl) and windows

From: Cris Bailiff <c.bailiff+curl_at_awayweb.com>
Date: Wed, 6 Nov 2002 10:51:30 +1100

On Tue, 5 Nov 2002 01:42 am, lupusdacicus wrote:
....
> Try to run the CL compiler.
> When trying to use CL compiler, it said that it couldn't find mspdb60.dll.
>
> I looked/searched for the damn file and I found it in another directory
> from Micro$oft Visual C. Copied the damn file into C:\windows\system
>
> Tried again to do make. Cl crashed again. Now I open the easy.c file and
> try to debug it.

I don't think there's anything wrong with easy.c - but beware that 'easy.c' is
made (by perl.exe) from 'easy.xs', and that much of what you are trying to
change is put there by your 'perl.exe' because it "knows what's correct".

> After trying to build easy.c, it says it cannot find extern.h,
> perl.h and XSUB.h. I modify the path on #include <> statemant, but
> obviously I cannot remember the right syntax, because it wouldn't look on
> the path given.
...
> Now it
> says something that cannot find/open config.h. It is like the other ones in
> C:\perl\bin\CORE
> Now it says it cannot find arpa\inet.h
> I am getting tired of copying the files from C:\perl\bin\Core and I wish I
> knew where should I modify the path to my perl directory.

There are a very large number of include files that will be requested by
almost any piece of C code, including those in the perl directory and those
'standard' headers that should be provided by your system (or compiler).

Rather than copying them all over to the Curl::easy directory, you should be
able to tell your compiler where to find them all itself.

The headers for perl itself seemt to be already correct in your Makefile, as
the 'cl' command you showed previously had

"-IC:\Perl\lib\CORE"

as one of its options. The other headers you mentioned (arpa/inet.h etc.)
would be considered 'standard' system headers on unix, but I don't know where
they might be on your system. I imagine they are under the Visual C
directories somewhere, in which case I would have expected 'cl' to be able to
find them itself.

> I looked in
> Makefile and I do have PERL_INC = C:\Perl\lib\CORE, but nothing. I copied
> arpa directory into C:\perl\lib\site\Curl, where I am trying to compile
> easy.c, but Visual C debugger says:
> c:\perl\site\lib\curl\perl.h(662) : fatal error C1083: Cannot open include
> file: 'arpa/inet.h': No such file or directory
> Error executing cl.exe.

I would give up copying everything, and look for a simpler root cause -
perhaps your compiler isn't quite configured properly, or it's settings are
different from the ones used when perl.exe was made.

> Now it opens socket.h, but it cannot find win32.h
> I copy the whole C:\Perl\lib\CORE to C:\perl\site\lib\Curl
> Bad choice... It rewrote perl.h too and now I have to restart all over
> again from arpa/inet.h

....

> I kept modyifying paths..... until I got to this:
>
> --------------------Configuration: easy - Win32 Debug--------------------
> Compiling...
> easy.c
> easy.xs(174) : warning C4101: 'sv' : unreferenced local variable
> easy.xs(380) : warning C4018: '<' : signed/unsigned mismatch

These are just warnings, and can be ignored. I will note them for attention in
a future release.

> Linking...
> easy.obj : error LNK2001: unresolved external symbol __imp__win32_fwrite
> easy.obj : error LNK2001: unresolved external symbol __imp__win32_stdout
> easy.obj : error LNK2001: unresolved external symbol _Perl_sv_2io
....snip....
> easy.obj : error LNK2001: unresolved external symbol _Perl_newXS
> LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
> Debug/easy.exe : fatal error LNK1120: 62 unresolved externals
> Error executing link.exe.

When compiling, your compiler can't find the headers, and this is fixed by
telling it where to look with -I . Now your are linking, and your linker
can't find the appropriate libraries (perl.dll or whatever). You'll have to
tell the linker where to look for libraries using the -L option.

Normally the -I and -L options are put into the Makefile by perl when you run
'perl Makefile.PL', but the values you need are different from the ones perl
"knows", which are the ones used by Active State when they made perl.exe.

You seem to need to change both the LIBS and INC options, either by editting
Makefile.PL, or using 'perl Makefile.PL LIBS=c:\blah\blah INC=c:\blahblah'.

I don't know where anything is on your machine, so I can't tell you what
values you need to use though...

Cris

-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
Received on 2002-11-06