Why cant I use fftw3 with cmake

133 views Asked by At

I want to use fftw3 in a project, I am already using CMake in the project so I am trying to include the fftw3 library with CMake, I already modified my CMakeLists file to include fftw3 in my main source code I can include the library with no problems but when I try to use fftw_malloc() and use mingw32-make in the build directory it gives me an error:

undefined reference to `_imp__fftw_malloc'

this is my CMakeLists.txt file:

cmake_minimum_required(VERSION 3.12)
project(myproj)

add_subdirectory(raylib)

include_directories(fftw3)

add_executable(${PROJECT_NAME} main.c)

find_library(FFTW3_LIB fftw3 PATHS "fftw3")

target_link_libraries(${PROJECT_NAME} raylib ${FFTW3_LIB})

I was using raylib with cmake for the project thats with I want to use CMake for fftw3 too, the raylib source has a CMakeLists.txt file already so its easy to include it.

These are the files I have in my fft3 directory:

    bench.exe
    benchf.exe
    benchl.exe
    fftw-wisdom.exe
    fftw3.f
    fftw3.f03
    fftw3.h
    fftw3l.f03
    fftw3q.f03
    fftwf-wisdom.exe
    fftwl-wisdom.exe
    libfftw3-3.def
    libfftw3-3.dll
    libfftw3f-3.def
    libfftw3f-3.dll
    libfftw3l-3.def
    libfftw3l-3.dll

fftw3 directory has a the header file for fftw3 and it has the dll and def files

I am kinda new to CMake so I dont know if this is correct.

0

There are 0 answers