Reputation: 21
I have the following piece of code:
#include <stdio.h>
#include "S:\fftw\fftw3.h"
int main()
{
fftw_complex* in;
fftw_complex* out;
fftw_plan p;
in = (fftw_complex*)fftw_malloc(sizeof(fftw_complex));
out = (fftw_complex*)fftw_malloc(sizeof(fftw_complex));
p = fftw_plan_dft_1d(1, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(p);
fftw_destroy_plan(p);
fftw_free(in);
fftw_free(out);
printf("test!\n");
return 0;
}
when I compile with
gcc -g .\test.c -o test S:\fftw\libfftw3-3.dll
and execute the generated
test.exe
it does execute without errors but doesn't show the printf message. If I use gdb and simply run the program there, no matter what I try, gdb freezes and just gives the following output:
Starting program: S:\Notes\C\numerics\src\test.exe
[New Thread 8244.0x2a80]
[New Thread 8244.0x1668]
[New Thread 8244.0x4790]
[Thread 8244.0x1668 exited with code 3221225781]
This happens from the exact moment I call a function that has to be linked to the .dll, everything works fine if I don't.
I am using
gcc.exe (x86_64-win32-sjlj-rev0, Built by MinGW-W64 project) 8.1.0
and
GNU gdb (GDB) 8.1, This GDB was configured as "x86_64-w64-mingw32".
from MingW64 and I simply downloaded the fftw .dlls from the mainpage.
Can anyone help? I have absolutely no clue what this is about.
Upvotes: 2
Views: 306
Reputation: 322
From the debugger, you can see the exit code 3221225781, which is 0xC0000135 in hexadecimal. If you look it up on MS-ERREF, it means "STATUS_DLL_NOT_FOUND" and "{Unable To Locate Component} This application has failed to start because %hs was not found. Reinstalling the application might fix this problem."
Likely, the application can't find libfftw3-3.dll
. You need to either put it in the same directory of the executable, or in one of the other DLL search paths.
If you start the application from explorer (double clicking), it should also tell you that message, including the DLL name it couldn't find if you continue to get the same exit code.
Upvotes: 2