libwebp-0.4.3.tar.gz. In the readme file, it says to run this command:>nmake /f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output
So first I did the command, and it created a folder containing some '.exe', '.obj' and '.lib' files.
The readme also mention SWIG binding for java jni? So I downloaded it too (swigwin-3.0.7). After extracting it, I added them to environment-variable path.
Inside the \swig directory there is another readme that says to run this command:
$ gcc -shared -fPIC -fno-strict-aliasing -O2 \ -I/path/to/your/jdk/includes \ libwebp_java_wrap.c \ -lwebp \ -o libwebp_jni.so
Why is the output 'libwebp_jni.so', shouldn't it be '.dll' for jni? And so I modified that command to :
>gcc -shared -fPIC -fno-strict-aliasing -O2 -I"C:\Program Files\Java\jdk1.7.0_04\include" -I"C:\Program Files\Java\jdk1.7.0_04\include\win32" -I"C:\libwebp-0.4.3\src" -L"C:\libwebp-0.4.3\output\release-static\x86\lib" libwebp_java_wrap.c -lwebp -o libwebp_jni.dll
But I get this error:
C:\libwebp-0.4.3\swig>gcc -shared -fPIC -fno-strict-aliasing -O2 -I"C:\Program Files\Java\jdk1.7.0_04\include" -I"C:\Program Files\Jav\jdk1.7.0_04\include\win32" -I"C:\libwebp-0.4.3\src" -L"C:\libwebp-0.4.3\output\release-static\x86\lib" libwebp_java_wrap.c -lwebp -o libwebp_jni.dll
libwebp_java_wrap.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lwebp
collect2: ld returned 1 exit status
What is the correct way to build libwebp in Windows?
Sorry if this is a nooby question.
Thanks in advance!--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.
To post to this group, send email to webp-d...@webmproject.org.
Visit this group at http://groups.google.com/a/webmproject.org/group/webp-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.
Hello,
I've been trying to build libwebp to be used in Java. But currently I don't know the steps to do it properly.
I downloaded thelibwebp-0.4.3.tar.gz. In the readme file, it says to run this command:>nmake /f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output
So first I did the command, and it created a folder containing some '.exe', '.obj' and '.lib' files.The readme also mention SWIG binding for java jni? So I downloaded it too (swigwin-3.0.7). After extracting it, I added them to environment-variable path.
Inside the \swig directory there is another readme that says to run this command:
$ gcc -shared -fPIC -fno-strict-aliasing -O2 \ -I/path/to/your/jdk/includes \ libwebp_java_wrap.c \ -lwebp \ -o libwebp_jni.so
Why is the output 'libwebp_jni.so', shouldn't it be '.dll' for jni?
And so I modified that command to :>gcc -shared -fPIC -fno-strict-aliasing -O2 -I"C:\Program Files\Java\jdk1.7.0_04\include" -I"C:\Program Files\Java\jdk1.7.0_04\include\win32" -I"C:\libwebp-0.4.3\src" -L"C:\libwebp-0.4.3\output\release-static\x86\lib" libwebp_java_wrap.c -lwebp -o libwebp_jni.dll
But I get this error:
C:\libwebp-0.4.3\swig>gcc -shared -fPIC -fno-strict-aliasing -O2 -I"C:\Program Files\Java\jdk1.7.0_04\include" -I"C:\Program Files\Jav\jdk1.7.0_04\include\win32" -I"C:\libwebp-0.4.3\src" -L"C:\libwebp-0.4.3\output\release-static\x86\lib" libwebp_java_wrap.c -lwebp -o libwebp_jni.dll
libwebp_java_wrap.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lwebp
collect2: ld returned 1 exit status
libwebp> nmake /f Makefile.vc CFG=release-static RTLIBCFG=static
libwebp> cd swig
libwebp> cl /I../src /I"%JDK%\include" /I"%JDK\include\win32" ^
libwebp_java_wrap.c ^
/MT /LD /Fe:webp_jni.dll ^
..\..\obj\release-static\x64\lib\libwebp.lib
libwebp> "%JDK%\bin\javac.exe" -cp libwebp.jar libwebp_jni_example.java
libwebp> "%JDK%\bin\java.exe" -Djava.library.path=. -cp libwebp.jar;. libwebp_jni_example