标签:
编译步骤(x86版本)
1.下载并安装postgresql,点击进入下载地址。下载界面如下:
目前最新版本是9.5.1,我下载了 Win x86-32 的最新版本。安装后目录如下:
2.下载并解压缩libpqxx,点击进入下载地址。下载界面如下:
目前最新版本是4.0.1,我下载了libpqxx-4.0.1.tar.gz
压缩包。解压后目录如下:
3.编译环境准备。(安装或解压路径请以实际的为准,本文路径仅供参考)
# Common options for Visual C++ makefiles to build libpqxx and its regression # test. # THE ORIGINAL OF THIS FILE IS CALLED common-sample; DON'T EDIT THE ORIGINAL or # you may lose your changes when you upgrade your libpqxx sources. # Instead, copy "common-sample" to "common" and edit just the file "common". # Caution: on Windows, some environments, such as the "make" that comes with # Visual C++, expect you to use backslashes as path separators (for example, # "C:\src\libpqxx") whereas others like MinGW want you to use more conventional # slashes (as in "C:/src/libpqxx"). # Standard library namespace. # There are only two reasons why you might want to change this: # # 1. Your compiler doesn't define the standard library in the "std" namespace # but in the global namespace, in which case PGSTD should be the empty string. # However, a compiler with that problem is not likely to be good enough to # compile libpqxx. # # 2. You are using a third-party standard library implementation such as # STLport, which lives in another namespace to avoid clashes with the # implementation that came with the compiler. # # In the latter case, PGSTD must be set to the namespace used by your preferred # implementation. In all other cases, just leave this set to "std". STD="std" # If you are using a 3rd-party STL like STLport, remember to check your path # and be sure the STLport is included before the MSVC includes. VCVARS32.BAT # doesn't know anything about the directories as defined in the IDE. I use # # set INCLUDE=\Utility\Code\STLport-4.5\stlport;%INCLUDE% # # ...and set STD to "_STL". # Depending on your STL library min/max need to be defined. Using STLport # there is no need for libpqxx to redefine these for me. # The next line gives us the directory under which all PostgreSQL include # directories, DLLs and LIB files can be found. # # If you built PostgreSQL from source, this is probably the only line you # will need to change. # # If you installed PostgreSQL using the One Click Installer from EnterpriseDB, # comment out the following line and uncomment the line after it. # # Edit the appropriate line to match your specific installation. #PGSQLSRC="C:\Sources\postgresql-9.1.1\src" PGSQLSRC="D:\Program Files (x86)\PostgreSQL\9.5" # This is the directory where the Postgres header files, e.g. postgres_ext.h, # are found. PGSQLINC=$(PGSQLSRC)\include # This is the directory where the libpq header files, e.g. libpq-fe.h, # are found. If you used the One Click Installer, comment out the next line # and uncomment the one following it: #LIBPQINC=$(PGSQLSRC)\interfaces\libpq LIBPQINC=$(PGSQLSRC)\include # This is the directory where the release build of the libpq DLL # and its corresponding LIB file are found, as well as the names of # those two files. # # If you installed PostgreSQL using the One Click Installer from EnterpriseDB, # comment out the next three lines and uncomment the following three: #LIBPQPATH=$(PGSQLSRC)\interfaces\libpq\Release #LIBPQDLL=libpq.dll #LIBPQLIB=libpqdll.lib LIBPQPATH=$(PGSQLSRC)\lib LIBPQDLL=libpq.dll LIBPQLIB=libpq.lib # This is the directory where the debug build of the libpq DLL # and its corresponding LIB file are found, as well as the names of # those two files. # # NOTE: If you don't have access to a debug build of libpq, just # provide the same information as above here. The debug builds of # libpqxx will reference the release version of libpq, which will # only limit your ability to debug libpq sources but otherwise should # work just fine. # # If you installed PostgreSQL using the One Click Installer from EnterpriseDB, # comment out the next three lines and uncomment the following three. #LIBPQDPATH=$(PGSQLSRC)\interfaces\libpq\Debug #LIBPQDDLL=libpqd.dll #LIBPQDLIB=libpqddll.lib LIBPQDPATH=$(PGSQLSRC)\lib LIBPQDDLL=libpq.dll LIBPQDLIB=libpq.lib
图文说明Visual Studio 2013编译libpqxx步骤以及常见编译错误
标签:
原文地址:http://blog.csdn.net/fish_55_66/article/details/50955806