[Libpqxx-general] suggestion for more flexibility with win32 complilation process
Matthew Pugsley
matthew.pugsley at gmail.com
Sun Mar 1 19:35:49 UTC 2009
I got the static and dynamic files to compile! Woo hoo! I did have to
compile libpqdll.lib from the source for Postgres in order to compile
libpqxx.dll, but I was able to rely on my current directory structure
throughout. I've attached copies of the files that I edited in case they are
useful to anyone. (It turned out that the files made the message too big,
but I've described the edits I made.) I haven't yet written any code to
connect to the Postgres database. The tutorial is next on the agenda. But I
have been able to compile a program with all of the linking options setup.
In the past when I didn't have the linking options set correctly for some
MySQL code, Visual C++ complained. So I take this as a sign that the files
are being read correctly. Now I just need to learn how to use the library to
setup connections, transactions, and queries.
The following edits were made:
For common, I commented out everything except STD="std".
For the make file and template file:
In the section "# The options common to all the different builds", I
explicitly specified the include information.
In the LINK_FLAGS_BASE identifier, I explicitly specified the library
location.
In the "# Physical targets" section, I explicitly specified the copy to and
from locations. Even apart from concerns about directory structure, it
seemed that the compiler was unhappy with a simple "lib" as the name of the
location to put the file. Fully specifing this helped. Using .\lib might
have worked, but I went for the full specification.
I also compiled libpqdll.lib from the Postgres source and copied this to the
lib directory within my Postgres installation.
Compilation:
nmake /f win32\vc-libpqxx.mak STATICRELEASE
nmake /f win32\vc-libpqxx.mak DLLRELEASE
Worked perfectly!
(I noted from reading the make file that the conditionality I requested is
already built into the make file. I was able to avoid the debug code by
using the STATICRELEASE and DLLRELEASE options. It might be helpful to other
users if the availability of these options is mentioned in the INSTALL.txt
file.)
Thanks for the library!
--Matt Pugsley
--
matthew.pugsley at gmail.com
P.S. I would've added to my earlier thread, but I don't know how. I'm going
to try to add to it by using the same subject line.
--
matthew.pugsley at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/libpqxx-general/attachments/20090301/c2e84062/attachment.html
More information about the Libpqxx-general
mailing list