Comments (8)
I presume you're using this with Java via JNI.
Did you build jnilib with the included makefile?
from libimagequant.
@kornelski Yes, I build it, and tried both .jnilib and .so file, but no lucky
from libimagequant.
The line that builds the lib is
$(CC) -g $(CFLAGS) $(LDFLAGS) $(JAVAINCLUDE) -shared -o $@ $(STATICLIB) org/pngquant/PngQuant.c
where $(STATICLIB)
is libimagequant.a
, and should be linked and contain the required symbols.
If you run this:
nm libimagequant.a | grep liq_attr_create
does it print something like:
0000000000000900 T _liq_attr_create
?
from libimagequant.
It prints
0000000000003160 T liq_attr_create
00000000000032f0 T liq_attr_create_with_allocator
from libimagequant.
That looks fine. I'm not sure why java is failing to find it.
Maybe try compiling with -fPIC
?
make clean
./configure CFLAGS=-fPIC
make java
from libimagequant.
Tried CFLAGS=-fPIC and still not work!
from libimagequant.
same error here in centos7 with compiler gcc(4.8.5)
but i think i find a solution somehow, it worked at least. ´_>`
- in line 68 in makefile, put
$(STATICLIB)
to the end
$(CC) -g $(CFLAGS) $(LDFLAGS) $(JAVAINCLUDE) -shared -o $@ org/pngquant/PngQuant.c $(STATICLIB)
- run
make java
and get filelibimagequant.jnilib
- use
libimagequant.jnilib
in Java code
static {
System.load("/absolute/path/libimagequant.jnilib");
// if you put the lib to libpath like /usr/lib, hmmm.. maybe a '.so' suffix is required
// System.loadLibrary("imagequant");
}
IMPORTANT: the filesize of libimagequant.jnilib
is 126K while it is 53K before the change of makefile
i guess the previous libimagequant.jnilib(53K)
does not include libimagequant.a
hope it helps :)
from libimagequant.
Thanks for the tip. I've moved the library to the end of the linker invocation. What a magic…
from libimagequant.
Related Issues (20)
- smarter color reducer? (considering visual similarity) HOT 2
- Duplicate transparency palette entry generated since v4.0.0 with some inputs HOT 1
- 2.18.0: build fails on linking HOT 5
- faster in c++ than in rust? HOT 1
- Could libimagequant be extended to more than 256 colours? HOT 1
- Please don't hide Cargo.lock HOT 2
- imagequant-sys: Makefile problem HOT 3
- keep alpha channel HOT 1
- libimagequant_sys: missing shared library HOT 5
- Generate c static library problem HOT 5
- Problems from Java developers
- Different results on ppc64le HOT 7
- Latest version doesn't appear to be compiled HOT 3
- Test failure on big-endian HOT 2
- Process images with premultiplied alpha HOT 2
- Some question about LISENCE. HOT 1
- The color channel of the palette, red and blue reverse,Only the following code is the correct color result HOT 4
- can not get the target .a file by use cargo build HOT 6
- Big resolution images crash the library
- latest version of libimagequant seems not be compiled on Windows HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libimagequant.