Em seg., 10 de fev. de 2020 às 10:53, Craig Ringer <craig@2ndquadrant.com> escreveu:
On Mon, 10 Feb 2020 at 20:14, Ranier Vilela <ranier.vf@gmail.com> wrote: > > "adminpack.obj : error LNK2019: sφmbolo externo indefinido _Int64GetDatum referenciado na funτπo _pg_file_write [C:\dll\postgres\adminpack.vcxproj] > .\Release\adminpack\adminpack.dll : fatal error LNK1120: 1 externo nπo resolvidos [C:\dll\postgres\adminpack.vcxproj] > Done Building Project "C:\dll\postgres\adminpack.vcxproj" (default targets) -- FAILED."
You are almost certainly trying to build with a mismatched configuration vs toolchain. See "postgres.h" for the definition of Int64GetDatum. It's a macro if you're on a 64-bit arch where we can pass 64-bit fields by-value efficiently; otherwise it's a function. You're probably trying to link 32-bit extensions against a 64-bit postgres.
Clean everything. Completely. Set up a totally clean MSVC environment and ensure you have ONLY the 32-bit toolchain on the PATH, only 32-bit libraries, etc. Then retry.
Rather than building via MSVC's user interface, use msbuild.exe with the project files PostgreSQL generates for you.
See if that helps.
I've seen many mangled setups when there are mixes of different MSVC toolchains versions on a machine. I now maintain isolated VMs with exactly one MSVC version on each to address the amazing level of breakage and incompatibility that MS's various toolchains seem to deliver.
You know those times when you feel like you haven't done your job. This is one of them. Thanks Craig and Michael, my mistake, the 32 bits project build was done complete. There was really a mixing problem between 32 and 64 bits compilations. After downloading the current full version of the sources again and starting the 32 bits compilation, everything went well. It's great to know that Postgres compiles and runs all regression tests in 32 bits (all 196).