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

Not a valid Win32 application. #29

Closed
sametaylak opened this issue Jul 24, 2021 · 6 comments
Closed

Not a valid Win32 application. #29

sametaylak opened this issue Jul 24, 2021 · 6 comments

Comments

@sametaylak
Copy link

sametaylak commented Jul 24, 2021

I am building libfzf.dll like this:

gcc -O3 -Wall -Werror -fpic -shared src/fzf.c -o build/libfzf.dll

gcc --version output:

gcc.exe (MinGW.org GCC-6.3.0-1) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc -v output:

Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --with-gmp=/mingw --with-mpfr --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
Error detected while processing C:\Users\samet\AppData\Local\nvim\init.vim:
line  149:
E5108: Error executing lua ...lugged\telescope.nvim\lua\telescope\_extensions\init.lua:11: This extension doesn't exist or is not installed: fzf
...t\.vim\plugged\telescope-fzf-native.nvim\lua\fzf_lib.lua:11: cannot load module 'C:\Users\samet\.vim\plugged\telescope-fzf-native.nvim\lua\../build/libfzf.dll': %1 is not a valid Win32 application.

I am currently stuck with this issue!

@Conni2461
Copy link
Member

The first thing i notice is that i am not using the correct separator for windows but i dont think this is the issue here because i had people report that everything is working.
I am not much of a help when it comes windows because i dont own a windows device. If you find some time it would be cool if you could me @l-kershaw :) thanks

@l-kershaw
Copy link

Hi @sametaylak, I won't pretend to fully understand what goes on in telescope-fzf-native.nvim, but a couple of things that I wanted to check:

  • You give the command that you are using to compile the build. Are you typing this yourself, or are you using the makefile?
  • Your gcc is from 2016, have you tried updating it?
  • Does the build create a .dll file where you would expect?

Also, for completeness, could you provide a copy of your configuration as it pertains to telescope.nvim and telescope-fzf-native.nvim (both for installing the plugins and the setup and load_extension calls)?

@sametaylak
Copy link
Author

First answer: I am typing myself.
Second answer: I haven't. I used mignw-get-setup.exe for installing gcc.
Third answer: Yeah, It is creating a .dll file called libfzf.dll.

Vim plugins:

call plug#begin('~/.vim/plugged')

Plug 'neoclide/coc.nvim', {'branch': 'release'}

Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'


Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' }

Plug 'fannheyward/telescope-coc.nvim'

call plug#end()

Telescope setup in the end of init.vim file

lua << EOF
require('telescope').setup {
  extensions = {
    fzf = {
      fuzzy = true,                    -- false will only do exact matching
      override_generic_sorter = false, -- override the generic sorter
      override_file_sorter = true,     -- override the file sorter
      case_mode = "smart_case",        -- or "ignore_case" or "respect_case"
                                       -- the default case_mode is "smart_case"
    }
  }
}
-- To get fzf loaded and working with telescope, you need to call
-- load_extension, somewhere after setup function:
require('telescope').load_extension('fzf')
require('telescope').load_extension('coc')
EOF

@Conni2461
Copy link
Member

Conni2461 commented Jul 24, 2021

Maybe this could help https://stackoverflow.com/a/17873843 gcc -m32 i think or maybe you need a 64bit gcc. Dont know which way around

@sametaylak
Copy link
Author

I fixed this issue with msys2 installation.

gcc --version output:

gcc.exe (Rev5, Built by MSYS2 project) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc -v output:

Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-10.3.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-lto --enable-libgomp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev5, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-boot-ldflags='-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,--disable-dynamicbase -static-libstdc++ -static-libgcc' 'LDFLAGS_FOR_TARGET=-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high' --enable-linker-plugin-flags='LDFLAGS=-static-libstdc++\ -static-libgcc\ -pipe\ -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high\ -Wl,--stack,12582912'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.0 (Rev5, Built by MSYS2 project)

@Conni2461
Copy link
Member

Good to hear :)

Closing for now. Feel free to reopen if you have further issues

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

3 participants