Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link .lib library in linux

Tags:

gcc

I'm pretty new to c programming and want to port a windows c application to linux. My code uses a .lib file va_g729.lib - is it possible to use the same library in Linux and compile it with gcc?

All my .c and .h files along with the one .lib files are in the same directory. What I'm doing now is executing this command in the directory:

gcc *.c -lm

and I get following errors:

lbcodec2.c:(.text+0xa6b): undefined reference to `va_g729a_init_encoder'
lbcodec2.c:(.text+0xa83): undefined reference to `va_g729a_encoder'
collect2: error: ld returned 1 exit status

Is it possible to link the .lib file and compile with gcc?

Thanks.

like image 595
Shafiul Avatar asked Oct 22 '25 22:10

Shafiul


1 Answers

Seems like we can not compile the .lib file. I had to compile a .a file for linux from the source code.

like image 138
Shafiul Avatar answered Oct 25 '25 01:10

Shafiul



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!