kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.64k stars 252 forks source link

Building KFR C API - MSVC2017 #160

Closed durfejs closed 1 year ago

durfejs commented 2 years ago

Hello I try to build KFR C API with MSVC2017 according to instructions in README. However this is the error message :

lld-link: error: : undefined symbol: mainCRTStartup

The whole log:

C:\Users\msd\DSP\kfr\build>cmake -GNinja -DENABLE_CAPI_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="C:\Program Files\LLVM\bin\clang-cl.exe" .. -- The CXX compiler identification is Clang 14.0.6 with MSVC-like command-line -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: C:\Program Files\LLVM\bin\clang-cl.exe -- Check for working CXX compiler: C:\Program Files\LLVM\bin\clang-cl.exe - broken CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeTestCXXCompiler.cmake:62 (message): The C++ compiler

"C:\Program Files\LLVM\bin\clang-cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/msd/DSP/kfr/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/PROGRA~1/NINJA-~1/ninja.exe cmTC_9cb05 && [1/2] Building CXX object CMakeFiles\cmTC_9cb05.dir\testCXXCompiler.cxx.obj

[2/2] Linking CXX executable cmTC_9cb05.exe

FAILED: cmTC_9cb05.exe cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_9cb05.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\mt.exe --manifests -- C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo CMakeFiles\cmTC_9cb05.dir\testCXXCompiler.cxx.obj /out:cmTC_9cb05.exe /implib:cmTC_9cb05.lib /pdb:cmTC_9cb05.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK Pass 1: command "C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo CMakeFiles\cmTC_9cb05.dir\testCXXCompiler.cxx.obj /out:cmTC_9cb05.exe /implib:cmTC_9cb05.lib /pdb:cmTC_9cb05.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_9cb05.dir/intermediate.manifest CMakeFiles\cmTC_9cb05.dir/manifest.res" failed (exit code 1) with the following output: lld-link: error: : undefined symbol: mainCRTStartup ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:23 (project)

-- Configuring incomplete, errors occurred! See also "C:/Users/msd/DSP/kfr/build/CMakeFiles/CMakeOutput.log". See also "C:/Users/msd/DSP/kfr/build/CMakeFiles/CMakeError.log". You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_CXX_COMPILER= C:\Program Files\LLVM\bin\clang-cl.exe

-- Generating done CMake Warning: Manually-specified variables were not used by the project:

ENABLE_CAPI_BUILD

CMake Generate step failed. Build files cannot be regenerated correctly.

Can anybody give me a hint what is wrong?

dancazarin commented 1 year ago

Hello, It's configuration issue. CMake failed to compile test program before even loading any code of KFR. Maybe you use x86 MSVS environment to build x64 program?

dancazarin commented 1 year ago

Closing due to inactivity. Reopen if it's still actual.