You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. What I Did (Step by Step)
Following your instructions, I successfully ran the following commands from a directory (C:\users\username\somefolder) with the libpqxx-master directory contained within it: cmake -S libpqxx-master -B build -DCMAKE_INSTALL_PREFIX="libpqxx" cmake --build build --target INSTALL
I then copied the basic_libpqxx.props file from your repository into the libpqxx subdirectory that was created as a result of the above commandline instructions.
I then used the Property Manager tab in Visual Studio to add basic_libpqxx.props as an existing property sheet.
I then added the file basic_DLL.props into the libpqxx subdirectory and added a bin folder containing the DLL files: libpq.dll, libcrypto-1_1-x64.dll, libiconv-2.dll, libintl-8.dll, libssl-1_1-x64.dll - since I am using PostgreSQL version 12.
I then used the Property Manager tab in Visual Studio to add basic_DLL.props as an existing property sheet.
Which is where your Basic Build Process instructions appear to end.
2. The Issue
However, when I place the following line into my Visual Studio cpp project file: #include <pqxx/pqxx>
It cannot successfully build because VS cannot find the file pqxx/pqxx.
Do you know where I've got it wrong?
3. My Hypothesis
I suspect it has to do with the basic_libpqxx.props file I downloaded from your directory and added to my Visual Studio project using the Property Manager tab, since it is not clear to me how that file will know the path to the libpqxx folder (that was created as a result of the cmake commandline instructions - in this case "C:\users\username\somefolder\ libpqxx") and hence communicate that information to the VS project. I'm attaching the basic_libpqxx.props and the basic_DLL.props file for reference. (I've added the extension ".txt" to their name, in order for them to be successfully uploaded to GitHub, without changing their contents!). basic_DLL.props.txt basic_libpqxx.props.txt
The text was updated successfully, but these errors were encountered:
Sorry I have not looked in to see these issues for quite a while.
I will note that the reference "(Configuration)\lib" was to a "lib" subdirectory of the project into which my larger batch file copied files. I don't remember exactly the details. Without "lib" this is just a repeat of a directory the project will probably look anyway.
One way or another you have to refer to the location where the missing include files will be. In my automation I had that all copied or referenced so it worked. You appear to not be using the automation, so need to get all the locations referenced or copies made yourself. (Copies are bad since they become out of date, BTW.)
Also remember that the issue of where include files exist is separate from where library files exist, may be separate lines of the .props file. Sorry I am not directly helping, as I am tied up with project work for a bit longer and out of time.
Also the system knows the location of the .props file--that is how it finds files relative to that location as it preserves the location the file comes from. The .props file must therefore be placed relative to the library and include files consistent with the way the links inside that file are written. Then the act of inserting the properties links the locations.
1. What I Did (Step by Step)
Following your instructions, I successfully ran the following commands from a directory (C:\users\username\somefolder) with the libpqxx-master directory contained within it:
cmake -S libpqxx-master -B build -DCMAKE_INSTALL_PREFIX="libpqxx"
cmake --build build --target INSTALL
I then copied the basic_libpqxx.props file from your repository into the libpqxx subdirectory that was created as a result of the above commandline instructions.
I then edited line 17 from as it was previously:
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)$(Configuration)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
to:
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)$(Configuration)C:\Program Files\PostgreSQL\12\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
(Although I cant help but wonder if you really meant for line 18 to be edited as needed) NB: I already tried both possibilities, regardless:
<AdditionalDependencies>pqxx.lib;C:\Program Files\PostgreSQL\12\lib\libpq.lib;wsock32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
I then used the Property Manager tab in Visual Studio to add basic_libpqxx.props as an existing property sheet.
I then added the file basic_DLL.props into the libpqxx subdirectory and added a bin folder containing the DLL files: libpq.dll, libcrypto-1_1-x64.dll, libiconv-2.dll, libintl-8.dll, libssl-1_1-x64.dll - since I am using PostgreSQL version 12.
I then used the Property Manager tab in Visual Studio to add basic_DLL.props as an existing property sheet.
Which is where your Basic Build Process instructions appear to end.
2. The Issue
However, when I place the following line into my Visual Studio cpp project file:
#include <pqxx/pqxx>
It cannot successfully build because VS cannot find the file pqxx/pqxx.
Do you know where I've got it wrong?
3. My Hypothesis
I suspect it has to do with the basic_libpqxx.props file I downloaded from your directory and added to my Visual Studio project using the Property Manager tab, since it is not clear to me how that file will know the path to the libpqxx folder (that was created as a result of the
cmake
commandline instructions - in this case "C:\users\username\somefolder\ libpqxx") and hence communicate that information to the VS project. I'm attaching the basic_libpqxx.props and the basic_DLL.props file for reference. (I've added the extension ".txt" to their name, in order for them to be successfully uploaded to GitHub, without changing their contents!).basic_DLL.props.txt
basic_libpqxx.props.txt
The text was updated successfully, but these errors were encountered: