Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22070

How can I link the 3rd party library bzip2 in my gcc compiler?

$
0
0

I'm a python developer new to C and developing C code on Windows that needs to work on Windows and Linux.

To that end, I downloaded MSYS2 and used pacman to install gcc and bz2.

My question is: How do I use bzip2 in my C code.

When I try to compile this C code:

#include <bzlib.h>

using the command gcc test.c -lbzip2 -o test.out I get the following error:

test.c:1:10: fatal error: bzlib.h: No such file or directory

Am I including the correct header file? Am I linking it correctly?

When not using 3rd party libraries a simple "hello world" program compiles and executes fine.


Viewing all articles
Browse latest Browse all 22070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>