Hi Allwin,
Am 05.02.2013 18:57, schrieb ALLWIN JEFRED:
Has anyone been able to build curl for java binding using the below code

http://svwe10.itex.at/curl/curl-java/

I tried it in mingw32 using Win7 32 bit got errors that some of the
library files are not found

I am trying to build curl with ssl support

Do i need to build any other libraries too??

This is the error message I get

C:/Program Files/Java/jdk1.7.0_01/bin/javah net.haxx.curl.CurlGlue
touch CurlGlue.h
gcc -o javacurl.dll javacurl.o -lwsock32 -lwinmm -lcurldll -lzdll -L
"C:/MinGW/s
rc/openssl-1.0.1c/out" -L "C:/Users/xxxxx/Desktop/Blog
POsts/curl-7.28.1/lib" -
L C:/MinGW/src/zlib-1.2.7 -lssl32 -leay32
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:
cannot find *-lcurldll*
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:
cannot find*-lzdll*
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:
cannot find *-lssl32*
collect2.exe: error: ld returned 1 exit status
Makefile:110: recipe for target 'javacurl.dll' failed
mingw32-make: *** [javacurl.dll] Error 1

Do I need add some more dll in mingw32 lib directory??
no. You should not add any libs into the mingw32 lib directory but instead point the compiler/linker with -L to the right path (as you can see that the Makefile.32 does already). The reason that the linker doesnt find libcurldll.a is that there is simply the path to a proper "libcurl SDK" missing; if you have build libcurl self then you can find this lib in the curl-7.x.y/lib folder.

Then I found a couple of issues with the makefile when used with such a "libcurl SDK"; the original Makefile.m32 was designed to work with source trees instead. I had no time to make it really nice now, but I've hacked a bit around and made the Java binding compile and work with recent libcurl SDK from the download page:
http://curl.haxx.se/gknw.net/7.29.0/dist-w32/curl-7.29.0-devel-mingw32.7z
in addition I created another libcurl SDK which uses the recently introduced WinSSL instead of OpenSSL:
http://svwe10.itex.at/curl/curl-java/curl-7.29.0-winssl-sspi-spnego-zlib-devel-w32.7z
and here's a patched curl-java-0.2.3 package with hacked Makefile.m32 and a myset.[bat|sh] which shows you how to set the vars needed:
http://svwe10.itex.at/curl/curl-java/curl-java-0.2.3-p.7z

to compile simply extract the SDK and the java-curl package into a common directory (.f.e. c:/projects) and then open either a CMD shell:
cd \projects\curl-java-0.2.3
myset.bat
mingw32-make -f Makefile.m32 [test]

or a MinGW bash shell:
. myset.sh
make -f Makefile.m32 [test]

If you choose to use your own libcurl and OpenSSL builds then you should self copy together such a SDK which makes things way easier; also for using OpenSSL you need to uncomment some lines in the makefile (the OpenSSL Win32 lib names have changed from 0.9.8 to 1.0.x) depending on if you want to link statically or if you want to use the static lib.

I have not yet fixed the trunk version since this one uses a Java namespace, and I had problems to get this properly compiled - might be this is related to the fact that I tried with an older JDK-1.5 ...

if you have still problems dont hesitate to ask!

HTH, Gün.



-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to