microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.93k stars 6.33k forks source link

[FFTW3] Some symbols not exported properly on Windows? #39719

Open kwsp opened 3 months ago

kwsp commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

Environment

To Reproduce Steps to reproduce the behavior:

  1. Clone this MRE on a Windows machine https://github.com/kwsp/repro_fftw_version
  2. Try to build with the CMake Preset "Win64".

Expected behavior Builds fine. The same repo builds and runs on a M1 mac (see https://github.com/microsoft/vcpkg/issues/39717)

Failure logs -(please attached failure logs)

[main] Building folder: repro_fftw_version main
[build] Starting build
[proc] Executing command: chcp
[proc] Executing command: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build C:/src/repro_fftw_version/build/win64 --config Release --target main
[build] MSBuild version 17.9.8+b34f75857 for .NET Framework
[build] 
[build] main.obj : error LNK2019: unresolved external symbol fftw_version referenced in function main [C:\src\repro_fftw_version\build\win64\src\main.vcxproj]
[build] C:\src\repro_fftw_version\build\win64\src\Release\main.exe : fatal error LNK1120: 1 unresolved externals [C:\src\repro_fftw_version\build\win64\src\main.vcxproj]
[proc] The command: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build C:/src/repro_fftw_version/build/win64 --config Release --target main exited with code: 1
[driver] Build completed: 00:00:00.464
[build] Build finished with exit code 1

Additional context

This is weird because from what I can see, the symbol fftw_version is exported in the lib and dll. So I'm puzzled about why this specific symbol is giving issues. All other fftw functions work as far as I can tell.

(base) PS C:\src\repro_fftw_version> dumpbin /exports .\build\win64\vcpkg_installed\x64-windows\lib\fftw3.lib | findstr fftw_version
                  fftw_version
(base) PS C:\src\repro_fftw_version> dumpbin /exports .\build\win64\vcpkg_installed\x64-windows\bin\fftw3.dll | findstr fftw_version
        123   7A 000CF260 fftw_version = fftw_version
Cheney-W commented 3 months ago

I could reproduce this issue in my side with the latest vcpkg.