Git Product home page Git Product logo

Comments (3)

gen2brain avatar gen2brain commented on July 23, 2024

Seems you are trying to use both vendor and extlib? Remove vendor, it will not copy all necessary files. If you want to pass additional LDFLAGS/CFLAGS that is done by using CGO_CFLAGS and CGO_LDFLAGS. You can search issues to see how it is done in Dockefile if you want to use an external library.

from go-fitz.

gen2brain avatar gen2brain commented on July 23, 2024

Btw. you can use an external library, that is why there is a tag for that, not sure how you understood that the bundled library is the only way.

$ go mod init example
$ go mod tidy
$ go build -tags extlib
$ ldd ./example 
	linux-vdso.so.1 (0x00007ffd181c8000)
	libmupdf.so.1.19.0 => /usr/lib64/libmupdf.so.1.19.0 (0x00007f65b7835000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f65b7760000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f65b7563000)
	libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f65b749b000)
	libgumbo.so.1 => /usr/lib64/libgumbo.so.1 (0x00007f65b743c000)
	libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007f65b7343000)
	libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007f65b72af000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f65b7295000)
	libjbig2dec.so.0 => /usr/lib64/libjbig2dec.so.0 (0x00007f65b7275000)
	libopenjp2.so.7 => /usr/lib64/libopenjp2.so.7 (0x00007f65b7216000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f65ba692000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f65b7203000)
	libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f65b71cc000)
	libgraphite2.so.3 => /usr/lib64/libgraphite2.so.3 (0x00007f65b71a4000)
	libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f65b706d000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f65b6ff6000)

Did you install static only library? In that case also add static tag, i.e. tags 'extlib static'.

from go-fitz.

gen2brain avatar gen2brain commented on July 23, 2024

Right, so brew installs only static libraries, this is from Catalina VM but probably the same on your OS.

% brew ls --verbose mupdf | grep lib
/usr/local/Cellar/mupdf/1.19.1/lib/libmupdf.a
/usr/local/Cellar/mupdf/1.19.1/lib/libmupdf-third.a

% ls -1
example.go
go.mod
go.sum
test.pdf

% go build -o example-embed

% go build -tags 'extlib static' -o example

% otool -L example-embed 
example-embed:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

% otool -L example
example:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

% ./example

from go-fitz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.