I've downloaded kiss fft from here .But I don't know really know how to use it in Visual Studio. For example, after I create an empty win32 project in Visual Studio, how should I copy paste the files in the zip file and change the command in the profile such that I can use all the functions in the kiss fft library?

Thanks for helping me out!

有帮助吗?

解决方案

If you have header (h) and and source (c) files in the zip, right click on your new empty project and add (the unzipped copies of) them.
You will need to set the include path to where they reside, so you can #include the header files you want.
And "unresolved externals" means it's seen a declaration, e.g. in a header file, but cannot find the definition.
Watch out for #including header files to C source in a C++ project. If you've included the source it will be looking for C++ unless you say otherwise. You will need to do this

extern "C" {
#include "fft_header.h"
}

Further details here


EDIT OK, I downloaded the files, made an empty Win32 console app, selected empty project, added the path to the additional include in the project. enter image description here Then I added a main file as follows along with adding the C file you mention in the download.

extern "C"
{
    #include "kiss_fft.h"
}

int main()
{
    kiss_fft_cfg cfg;
    kiss_fft_cpx *fin;
    kiss_fft_cpx *fout;
    kiss_fft(cfg, fin, fout);
}

I have warnings but no link errors.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top