i have a problem with Pgvector extension installation on Windows
so the code for installation is
set "PGROOT=C:\Program Files\PostgreSQL\15"
git clone --branch v0.4.2 https://github.com/pgvector/pgvector.git
cd pgvector
nmake /F Makefile.win
nmake /F Makefile.win install
and i am getting fatal error:
C:\Program Files\pgvector>nmake /F Makefile.win
C:\Program Files\PostgreSQL\15\lib\postgres.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86' vector.dll : fatal error LNK1120: 109 unresolved externals
and i get bunch of LNK 2001 & 2019 errors apart from these.
i'm using; MSVC v143 package Windows universal CRT SDK Windows 10 SDK
I'm not expert in compiling at all but I manage to do it. Here is how I did it:
How I compiled the extension:
download Visual studio community 2022 and install ALL component related to windows and C++ (I say ALL to not being bother with missing lib but if you lack of space you could cherry pick the lib to install)
find where is the vcvarsall.bat file (usually: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build)
download the pgvector extension from github and place it in a easily callable folder like: c:/pgvector
find the root folder of your postgresql installation (like: C:\Program Files\PostgreSQL\15)
identify the CPU you are using because you will need to choose a parameter later:
vcvarsall.bat x86_amd64
vcvarsall.bat x86_amd64 10.0.10240.0
vcvarsall.bat x86_arm uwp 10.0.10240.0
vcvarsall.bat x86_arm onecore 10.0.10240.0 -vcvars_ver=14.0
vcvarsall.bat x64 8.1
vcvarsall.bat x64 store 8.1
you are now ready !
find in the windows bar the following tool: Developer Command Prompt for VS 2022
type the following commands (adapt it if needed):
It works for me on two computers, hope it will work for you as well or could help other users in the future.