Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prajjwalkumar17 opened this issue Dec 7, 2023 · 7 comments
Open

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

prajjwalkumar17 opened this issue Dec 7, 2023 · 7 comments

Comments

@prajjwalkumar17
Copy link

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
Copy link
Member

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
Copy link
Author

prajjwalkumar17 commented Dec 8, 2023

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 Release directory 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
Copy link
Author

Can you help in this @Conni2461

@arwysyah
Copy link

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

@arwysyah
Copy link

arwysyah commented Dec 30, 2023

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
Copy link

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.

@jongbatax
Copy link

if you using lazyvim, just make build directory manually in telescope-fzf.nvim (mkdir build), then run make then type exit, I'm using windows 11, I think make command failed to created build folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants