navige
navige

Reputation: 2517

VS2012: building postgresql - LNK1120, 2001 - add dependency manually?

I'm trying to build postgresql on my Windows machine from within Visual Studio 2012. When I do so, I get for quite a lot of errors, all in the style of:

I read in quite a few places that having these errors one should specify that it is a console application rather than a win32 application, but: I didn't create the sln and vcxproj myself, but the build program created this in the first place. So, I can't do anything there, right?

I looked at other similar questions and somebody proposed to add the dll as an additional dependency (properties > configuration properties > linker > input > additional dependencies). And that actually worked, but is that really the solution? Do I have to manually add the dependencies on every single project? Or are there shortcuts to that?

Upvotes: 0

Views: 354

Answers (1)

Craig Ringer
Craig Ringer

Reputation: 324901

Visual Studio 2012 is not supported and will not work for PostgreSQL 9.2 and below. Even if you could resolve the immediate linker error, you will have problems with local and charset support among other things.

Use Visual Studio 2010 or older for Pg 9.2, or Visual Studio 2008 and older for 9.0 and below. The Express editions work fine, as does Windows SDK 7.1.

The upcoming PostgreSQL 9.3 will include Visual Studio 2012 support. It will not be back-patched into older versions.

See https://commitfest.postgresql.org/action/patch_view?id=1023 and http://www.postgresql.org/message-id/[email protected] for VS 2012 support.

For build instructions on Windows, please see http://www.postgresql.org/docs/current/static/install-windows.html . Read the current version, but be aware that if you're building an older version of the server you may also need older tools, so read the version of the docs for the old version too.

I've written some tools and instructions to help make builds easier; they're published here:

https://github.com/2ndQuadrant/pg_build_win

Your feedback would be greatly appreciated.

Upvotes: 3

Related Questions