jgaeddert / liquid-dsp

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

Where is "liquid_float_complex" defined? #209

Open Mabdalshakour opened 3 years ago

Mabdalshakour commented 3 years ago

Hi,

I am trying to use the library on windows in an FM transmitter MS Visual Studio project. I just copied the FM source files "freqmod.c" and "freqdem.c" and I am trying to include all required dependencies. I was stuck at the "liquid_xxxxx_complex" for double and floats, etc According to the documentation at liquidsdr.org/doc/datastuctures/ this data type is just a placeholder for the float complex and double comlex. How can I define it? I can't see it defined anywhere in the source code

Thank you, Regards, M. Osman

GkvJeep commented 3 years ago

MS not support c99 standard.

Mabdalshakour commented 3 years ago

Thank you so much. Sorry I am kinda newbie. Then I should use MinGW for example, right? I won't need to define liquid_float_complex by using it?

GkvJeep commented 3 years ago

https://github.com/cjcliffe/CubicSDR/tree/master/external/liquid-dsp

Mabdalshakour commented 3 years ago

Thank you for your help. After using MinGW for gcc compiler and C99, I am still getting errors in the frequency modulation/demodulation examples. for example: 2020-08-12_mingw_errors

Do you know of any well tested procedure to compile the source code in windows?

Thank you,

vsonnier commented 3 years ago

@Mabdalshakour The only procedure is the one I've written and can be be found at the place @GkvJeep indicated. The question is, do you really need to re-compile it ? Why not using the precompiled binaries ? They should work out of the box with any Visual Studio and Windows version. (the only dependency is MSVCRT.dll)

Now if you want to recompile it from the current source, this is more complicated : First you need to execute the liquid-dsp building procedure in a Linux environnement (or WSL on Windows 10) to create both the config.h and Makefile files. Then you need to merge the changes into the CubicSDR ones, keeping the MSYS2 specifics. You also need to merge the liquid.h changes into the include/liquid.h of CubicSDR. Only then you can execute the procedure How_to_build_liquid_dsp_for_Windows.txt.

Mabdalshakour commented 3 years ago

Thank you. I think I will just explain what I am doing so that you can guide me. I have an SDR platform that I am writing a Visual studio C program for it. It has many APIs in the project. What I want is to just integrate the frequency modulator from the Liquid-DSP open source library in my project. What I understand is the the liquid-DSP is written in C99 for the gcc compiler. So what should I do in order to be able to compile it in the Visual Studio project? If the liquid project is written in C, why I have many syntax errors even with MinGW?

Thank you very much

vsonnier commented 3 years ago

Hi @Mabdalshakour,

What I understand is the the liquid-DSP is written in C99 for the gcc compiler. So what should I do in order to be able to compile it in the Visual Studio project?

There is nothing you can do. You need MSYS2 to compile it, or use the CubicSDR pre-compiled binaries as I explained before.

You'll only need the libliquid.dll at runtime.

To develop in Visual Studio you'll need to use theCubicSDR include/liquid.h and reference the libliquid.lib in your VS project. That's all. You cannot compile the lib itself in Visual Studio, but can perfectly use the lib in a Visual Studio project.

CubicSDR on Windows is compiled with VS2015/17/19 using this MSYS2-compiled liquid-dsp with no problem. The only drawback is that you can't step in liquid-dsp code from the Visual Studio debbugger.

vsonnier commented 3 years ago

@Mabdalshakour FYI I've updated the pre-compiled Windows libraries to the latest liquid-dsp master : https://github.com/cjcliffe/CubicSDR/commit/d08b0be9bdf82ce687a96cc25db4ea8304e21448

brian-armstrong commented 3 years ago

I actually have a branch that builds in Windows/MSVC. It fixes this issue and others basically by making liquid look a bit more C++ compatible in places. It passes all tests but unfortunately it has drifted over time. https://github.com/quiet/quiet-dsp/tree/win

bignick26 commented 2 years ago

@brian-armstrong how did you handle the conflict with MCVC C++ Complex definition/standard? I am currently using @vsonnier's CubicSDR build, which has been worked awesome until I tried to use C++ and complex numbers.