pkg-config --static not working
- Dominant language
- TypeScript
- Stars
- 14.9k
- Forks
- 1.4k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
The static libraries have the name -static appended to them but pkg-config --static returns the regular name. I don't think there is a way to treat the library name as different for static in pkg-config.
libbrotlicommon-static.a
libbrotlidec-static.a
libbrotlienc-static.a
~~~
git clone https://github.com/google/brotli.git
mkdir brotli-build
cd brotli-build/
cmake -DBUILD_{SHARED,STATIC}_LIBS=ON ../brotli
make
sudo make install
~~~
~~~
cat << EOF > a.c
#ifdef __cplusplus
extern "C"
#endif
char BrotliDecoderDecompress ();
int main (void)
{
return BrotliDecoderDecompress ();
;
return 0;
}
EOF
~~~
~~~
$ gcc -o a a.c -static `pkg-config --static --libs libbrotlidec`
/usr/bin/ld: cannot find -lbrotlidec
/usr/bin/ld: cannot find -lbrotlicommon
collect2: error: ld returned 1 exit status
$ pkg-config --static --libs libbrotlidec
-L/usr/local/lib -lbrotlidec -lbrotlicommon
$ gcc -o a a.c -static -L/usr/local/lib -lbrotlidec-static -lbrotlicommon-static
$
~~~
Contributor guide
Assessment
This issue has not been assessed yet.