nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.4k stars 46 forks source link

Windows support: unsupported/corrupt libfzf.dll file #118

Open prajjwalkumar17 opened 10 months ago

prajjwalkumar17 commented 10 months ago

Hey @Conni2461,

Well going through this issue #43. The problem was the .dll wasn't found or was missing, we somehow needed to generate the file after installing make commands and running them and all.

I am facing a different yet similar kind of problem. In my case I have all the required files but it shows something like this Error detected while processing C:\Users\talk2\AppData\Local\nvim\init.lua:

E5113: Error while calling lua chunk: ...\start\telescope.nvim/lua/telescope/_extensions/init.lua:10: 'fzf' extension doesn't exist or isn't installed: ...k\packer\start\telescope-fzf-native.nvim/lua/fzf_lib.lua:11: cannot load module 'C:\Users\talk2\AppData\Local\nvim-data\site\pack\packer\start\telescope-fzf-native.nvim/lua/../build/libfzf.dll': %1 is not a valid Win32 application.

stack traceback:
        [C]: in function 'error'
        ...\start\telescope.nvim/lua/telescope/_extensions/init.lua:10: in function 'load_extension'
        ...\start\telescope.nvim/lua/telescope/_extensions/init.lua:62: in function 'load_extension'
        ...ers\talk2\AppData\Local\nvim/lua/pk/plugin/telescope.lua:27: in main chunk
        [C]: in function 'require'
        C:\Users\talk2\AppData\Local\nvim\init.lua:8: in main chunk

The configuration I have/followed is: Windows11 pro nvim custom setup using Packer.

I am attaching screenshots of my folder and my nvim files: Folder containing .dll file image

nvim error image

plugin.lua image

telescope.lua image

Conni2461 commented 10 months ago

yeah i also looking into that issue a couple of weeks back and noticed something weird.

i am no cmake expert, someone added it because they thought it would improve windows compatibility.

I noticed that it was enought to run cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release without that install command (cmake --install build --prefix build). After that the file build/libfzf.so already exists (at least on linux).

if i now run the install part: cmake --install build --prefix build, i get the error and the file no longer exists.

I could only confirm this on linux, so would be great if you can confirm that on windows.

Just open the directory, delete build/ and then only run cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release

thanks for looking into this :)

prajjwalkumar17 commented 10 months ago

Well after running this command ie. cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release We wouldn't be able to generate the .dll file in the build directory and is generated in Releasedirectory which is inside of build directory. Which won't allow the nvim being able to find the DLL file. image

So again we will get the error of nvim not able to find the .dll file: image

Well as I have described the issue above with using the make command in the directory we are able to successfully generate the build directory like this. image image

The folder and file placement is perfectly correct but the problem is while firing up the nvim we get error as follows.

Error detected while processing C:\Users\talk2\AppData\Local\nvim\init.lua:
E5113: Error while calling lua chunk: ...\start\telescope.nvim/lua/telescope/_extensions/init.lua:10: 'fzf' extension doesn't exist or isn't installed: ...k\packer\start\telescope-fzf-native.nvim/lua/fzf_lib.lua:11: cannot load module 'C:\Users\talk2\AppData\Local\nvim-data\site\pack\packer\start\telescope-fzf-native.nvim/lua/../build/libfzf.dll': %1 is not a valid Win32 application.

stack traceback:
        [C]: in function 'error'
        ...\start\telescope.nvim/lua/telescope/_extensions/init.lua:10: in function 'load_extension'
        ...\start\telescope.nvim/lua/telescope/_extensions/init.lua:62: in function 'load_extension'
        ...ers\talk2\AppData\Local\nvim/lua/pk/plugin/telescope.lua:27: in main chunk
        [C]: in function 'require'
        C:\Users\talk2\AppData\Local\nvim\init.lua:8: in main chunk
Press ENTER or type command to continue

image

prajjwalkumar17 commented 10 months ago

Can you help in this @Conni2461

arwysyah commented 9 months ago

i had the same error , its working fine on my Mac and Linux , but not in Windows.

arwysyah commented 9 months ago

its works on My Windows now, @prajjwalkumar17 what i did :

i just deleted build folder by make

make clean and then run cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release and then run run cmake --install build --prefix build it would be generated

fzf.lib libfzf.dll

capture

1305788589 commented 7 months ago

i just go to my C:\Users\...\AppData\Local\nvim-data\site\pack\packer\start\telescope-fzf-native.nvim folder and open cmd in this path and then run cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build. my plugins-setup.lua add this code use({ "nvim-telescope/telescope-fzf-native.nvim", run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }). Now the extention works well.