"Library not found error" with Go bindings #200

Closed
opened 2026-01-29 20:39:44 +00:00 by claunia · 7 comments
Owner

Originally created by @addityasingh on GitHub (Oct 8, 2017).

While trying to use the Go package cbrotli, I was getting error for File not found for all the header files <brotli/encode.h>, <brotli/decode.h>. I fixed this by adding the relative path as below:


#include "../../c/include/brotli/decode.h"

#include "../../c/include/brotli/encode.h"

But even after this I get ld: library not found for -lbrotlicommon error and have no clue how to fix this. Trying to run the cbrotli_test.go throws the same error as shown:

screen shot 2017-10-08 at 1 46 29 am
Originally created by @addityasingh on GitHub (Oct 8, 2017). While trying to use the Go package `cbrotli`, I was getting error for `File not found` for all the header files `<brotli/encode.h>`, `<brotli/decode.h>`. I fixed this by adding the relative path as below: ```go #include "../../c/include/brotli/decode.h" #include "../../c/include/brotli/encode.h" ``` But even after this I get **ld: library not found for -lbrotlicommon** error and have no clue how to fix this. Trying to run the `cbrotli_test.go` throws the same error as shown: <img width="1105" alt="screen shot 2017-10-08 at 1 46 29 am" src="https://user-images.githubusercontent.com/5351262/31312720-1a67597e-abcb-11e7-94ee-78f69be1c15a.png">
Author
Owner

@eustas commented on GitHub (Oct 11, 2017):

Going to dig into this problem soon. What build system do you use?

@eustas commented on GitHub (Oct 11, 2017): Going to dig into this problem soon. What build system do you use?
Author
Owner

@eustas commented on GitHub (Oct 11, 2017):

This works for me:

mkdir out
cd out
../configure-cmake --disable-debug
cmake ..
make -j8
make test
make install
cd ..

After this include/library not found errors do not occur:

go build ./go/cbrotli
@eustas commented on GitHub (Oct 11, 2017): This works for me: ``` mkdir out cd out ../configure-cmake --disable-debug cmake .. make -j8 make test make install cd .. ``` After this include/library not found errors do not occur: ``` go build ./go/cbrotli ```
Author
Owner

@addityasingh commented on GitHub (Oct 11, 2017):

I will give it a go. Thanks @eustas for the effort 👍

@addityasingh commented on GitHub (Oct 11, 2017): I will give it a go. Thanks @eustas for the effort 👍
Author
Owner

@addityasingh commented on GitHub (Oct 25, 2017):

@eustas Just as a side question, is there any existing usage/example of the go implementation somewhere. I tried below but to no avail:

godep save github.com/google/brotli/cbrotli

godep: Package (github.com/google/brotli/cbrotli) not found

godep save github.com/google/cbrotli

godep: Package (github.com/google/cbrotli) not found

@addityasingh commented on GitHub (Oct 25, 2017): @eustas Just as a side question, is there any existing usage/example of the `go` implementation somewhere. I tried below but to no avail: ``` godep save github.com/google/brotli/cbrotli ``` > godep: Package (github.com/google/brotli/cbrotli) not found ``` godep save github.com/google/cbrotli ``` > godep: Package (github.com/google/cbrotli) not found
Author
Owner

@eustas commented on GitHub (Nov 27, 2017):

I fear, I don't know any.
Going to investigate what is godep soon =)

@eustas commented on GitHub (Nov 27, 2017): I fear, I don't know any. Going to investigate what is `godep` soon =)
Author
Owner

@eustas commented on GitHub (Nov 27, 2017):

Even if godep save would finish successfully, it seem that it wouldn't work anyways: https://github.com/tools/godep/issues/422

@eustas commented on GitHub (Nov 27, 2017): Even if `godep save` would finish successfully, it seem that it wouldn't work anyways: https://github.com/tools/godep/issues/422
Author
Owner

@eustas commented on GitHub (Oct 24, 2018):

Merging with similar issue #585

@eustas commented on GitHub (Oct 24, 2018): Merging with similar issue #585
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#200