jgaeddert / liquid-dsp

digital signal processing library for software-defined radios
http://liquidsdr.org
MIT License
1.87k stars 438 forks source link

Cannot use liquid-dsp functions, undefined reference error #296

Closed kayakaan02 closed 2 years ago

kayakaan02 commented 2 years ago

Discussed in https://github.com/jgaeddert/liquid-dsp/discussions/295

Originally posted by **kayakaan02** August 24, 2022 So when I try to use liquid-dsp with including liquid.h, any function that is associated with liquid-dsp is giving me undefined reference to [function]. As an example, I used the code on liquidsdr website, matrix operations, first example usage of printing a matrix(https://liquidsdr.org/doc/matrix/) ![image](https://user-images.githubusercontent.com/110019265/186367816-c50c4229-9f1c-4bab-a88a-9e9887d9bf18.png) it gives me this error: ``` C:\Users\thevo\AppData\Local\Temp\ccIGgj1j.o:asdf.c:(.text+0xfc): undefined reference to 'matrixf_print' C:\Users\thevo\AppData\Local\Temp\ccIGgj1j.o:asdf.c:(.text+0x136): undefined reference to 'matrixf_ludecomp_doolittle' collect2.exe: error: ld returned 1 exit status ``` Also I tried the commenting out in the troubleshooting part

edit: So you may think I'm trying to run it on Windows because of C:/ directory, well yes but I get the same error message on Linux/Ubuntu too.

jgaeddert commented 2 years ago

Sounds like a linker error. Are you linking with "-lliquid"? Please include your command line here.

kayakaan02 commented 2 years ago

Sounds like a linker error. Are you linking with "-lliquid"? Please include your command line here.

Actually It seems like I haven't linked libliquid.a/libliquid.dll.a(created a new visual studio project and linked the libraries) so it was the problem. I am a little inexperienced so it was a newbie mistake.